google-cloud-metastore-v1beta 0.13.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -44,6 +44,9 @@ module Google
44
44
  # `projects/{project_number}/locations/{location_id}/federations/{federation_id}`.
45
45
  #
46
46
  class Client
47
+ # @private
48
+ API_VERSION = ""
49
+
47
50
  # @private
48
51
  DEFAULT_ENDPOINT_TEMPLATE = "metastore.$UNIVERSE_DOMAIN$"
49
52
 
@@ -175,14 +178,26 @@ module Google
175
178
  universe_domain: @config.universe_domain,
176
179
  channel_args: @config.channel_args,
177
180
  interceptors: @config.interceptors,
178
- channel_pool_config: @config.channel_pool
181
+ channel_pool_config: @config.channel_pool,
182
+ logger: @config.logger
179
183
  )
180
184
 
185
+ @dataproc_metastore_federation_stub.stub_logger&.info do |entry|
186
+ entry.set_system_name
187
+ entry.set_service
188
+ entry.message = "Created client for #{entry.service}"
189
+ entry.set_credentials_fields credentials
190
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
191
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
192
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
193
+ end
194
+
181
195
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
182
196
  config.credentials = credentials
183
197
  config.quota_project = @quota_project_id
184
198
  config.endpoint = @dataproc_metastore_federation_stub.endpoint
185
199
  config.universe_domain = @dataproc_metastore_federation_stub.universe_domain
200
+ config.logger = @dataproc_metastore_federation_stub.logger if config.respond_to? :logger=
186
201
  end
187
202
 
188
203
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
@@ -190,6 +205,7 @@ module Google
190
205
  config.quota_project = @quota_project_id
191
206
  config.endpoint = @dataproc_metastore_federation_stub.endpoint
192
207
  config.universe_domain = @dataproc_metastore_federation_stub.universe_domain
208
+ config.logger = @dataproc_metastore_federation_stub.logger if config.respond_to? :logger=
193
209
  end
194
210
  end
195
211
 
@@ -214,6 +230,15 @@ module Google
214
230
  #
215
231
  attr_reader :iam_policy_client
216
232
 
233
+ ##
234
+ # The logger used for request/response debug logging.
235
+ #
236
+ # @return [Logger]
237
+ #
238
+ def logger
239
+ @dataproc_metastore_federation_stub.logger
240
+ end
241
+
217
242
  # Service calls
218
243
 
219
244
  ##
@@ -297,10 +322,11 @@ module Google
297
322
  # Customize the options with defaults
298
323
  metadata = @config.rpcs.list_federations.metadata.to_h
299
324
 
300
- # Set x-goog-api-client and x-goog-user-project headers
325
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
301
326
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
302
327
  lib_name: @config.lib_name, lib_version: @config.lib_version,
303
328
  gapic_version: ::Google::Cloud::Metastore::V1beta::VERSION
329
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
304
330
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
305
331
 
306
332
  header_params = {}
@@ -322,7 +348,7 @@ module Google
322
348
  @dataproc_metastore_federation_stub.call_rpc :list_federations, request, options: options do |response, operation|
323
349
  response = ::Gapic::PagedEnumerable.new @dataproc_metastore_federation_stub, :list_federations, request, response, operation, options
324
350
  yield response, operation if block_given?
325
- return response
351
+ throw :response, response
326
352
  end
327
353
  rescue ::GRPC::BadStatus => e
328
354
  raise ::Google::Cloud::Error.from_error(e)
@@ -386,10 +412,11 @@ module Google
386
412
  # Customize the options with defaults
387
413
  metadata = @config.rpcs.get_federation.metadata.to_h
388
414
 
389
- # Set x-goog-api-client and x-goog-user-project headers
415
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
390
416
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
391
417
  lib_name: @config.lib_name, lib_version: @config.lib_version,
392
418
  gapic_version: ::Google::Cloud::Metastore::V1beta::VERSION
419
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
393
420
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
394
421
 
395
422
  header_params = {}
@@ -410,7 +437,6 @@ module Google
410
437
 
411
438
  @dataproc_metastore_federation_stub.call_rpc :get_federation, request, options: options do |response, operation|
412
439
  yield response, operation if block_given?
413
- return response
414
440
  end
415
441
  rescue ::GRPC::BadStatus => e
416
442
  raise ::Google::Cloud::Error.from_error(e)
@@ -505,10 +531,11 @@ module Google
505
531
  # Customize the options with defaults
506
532
  metadata = @config.rpcs.create_federation.metadata.to_h
507
533
 
508
- # Set x-goog-api-client and x-goog-user-project headers
534
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
509
535
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
510
536
  lib_name: @config.lib_name, lib_version: @config.lib_version,
511
537
  gapic_version: ::Google::Cloud::Metastore::V1beta::VERSION
538
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
512
539
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
513
540
 
514
541
  header_params = {}
@@ -530,7 +557,7 @@ module Google
530
557
  @dataproc_metastore_federation_stub.call_rpc :create_federation, request, options: options do |response, operation|
531
558
  response = ::Gapic::Operation.new response, @operations_client, options: options
532
559
  yield response, operation if block_given?
533
- return response
560
+ throw :response, response
534
561
  end
535
562
  rescue ::GRPC::BadStatus => e
536
563
  raise ::Google::Cloud::Error.from_error(e)
@@ -620,10 +647,11 @@ module Google
620
647
  # Customize the options with defaults
621
648
  metadata = @config.rpcs.update_federation.metadata.to_h
622
649
 
623
- # Set x-goog-api-client and x-goog-user-project headers
650
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
624
651
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
625
652
  lib_name: @config.lib_name, lib_version: @config.lib_version,
626
653
  gapic_version: ::Google::Cloud::Metastore::V1beta::VERSION
654
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
627
655
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
628
656
 
629
657
  header_params = {}
@@ -645,7 +673,7 @@ module Google
645
673
  @dataproc_metastore_federation_stub.call_rpc :update_federation, request, options: options do |response, operation|
646
674
  response = ::Gapic::Operation.new response, @operations_client, options: options
647
675
  yield response, operation if block_given?
648
- return response
676
+ throw :response, response
649
677
  end
650
678
  rescue ::GRPC::BadStatus => e
651
679
  raise ::Google::Cloud::Error.from_error(e)
@@ -729,10 +757,11 @@ module Google
729
757
  # Customize the options with defaults
730
758
  metadata = @config.rpcs.delete_federation.metadata.to_h
731
759
 
732
- # Set x-goog-api-client and x-goog-user-project headers
760
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
733
761
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
734
762
  lib_name: @config.lib_name, lib_version: @config.lib_version,
735
763
  gapic_version: ::Google::Cloud::Metastore::V1beta::VERSION
764
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
736
765
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
737
766
 
738
767
  header_params = {}
@@ -754,7 +783,7 @@ module Google
754
783
  @dataproc_metastore_federation_stub.call_rpc :delete_federation, request, options: options do |response, operation|
755
784
  response = ::Gapic::Operation.new response, @operations_client, options: options
756
785
  yield response, operation if block_given?
757
- return response
786
+ throw :response, response
758
787
  end
759
788
  rescue ::GRPC::BadStatus => e
760
789
  raise ::Google::Cloud::Error.from_error(e)
@@ -843,6 +872,11 @@ module Google
843
872
  # default endpoint URL. The default value of nil uses the environment
844
873
  # universe (usually the default "googleapis.com" universe).
845
874
  # @return [::String,nil]
875
+ # @!attribute [rw] logger
876
+ # A custom logger to use for request/response debug logging, or the value
877
+ # `:default` (the default) to construct a default logger, or `nil` to
878
+ # explicitly disable logging.
879
+ # @return [::Logger,:default,nil]
846
880
  #
847
881
  class Configuration
848
882
  extend ::Gapic::Config
@@ -867,6 +901,7 @@ module Google
867
901
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
868
902
  config_attr :quota_project, nil, ::String, nil
869
903
  config_attr :universe_domain, nil, ::String, nil
904
+ config_attr :logger, :default, ::Logger, nil, :default
870
905
 
871
906
  # @private
872
907
  def initialize parent_config = nil
@@ -26,6 +26,9 @@ module Google
26
26
  module DataprocMetastoreFederation
27
27
  # Service that implements Longrunning Operations API.
28
28
  class Operations
29
+ # @private
30
+ API_VERSION = ""
31
+
29
32
  # @private
30
33
  DEFAULT_ENDPOINT_TEMPLATE = "metastore.$UNIVERSE_DOMAIN$"
31
34
 
@@ -121,14 +124,6 @@ module Google
121
124
  # Lists operations that match the specified filter in the request. If the
122
125
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
123
126
  #
124
- # NOTE: the `name` binding allows API services to override the binding
125
- # to use different resource name schemes, such as `users/*/operations`. To
126
- # override the binding, API services can add a binding such as
127
- # `"/v1/{name=users/*}/operations"` to their service configuration.
128
- # For backwards compatibility, the default name includes the operations
129
- # collection id, however overriding users must ensure the name binding
130
- # is the parent resource, without the operations collection id.
131
- #
132
127
  # @overload list_operations(request, options = nil)
133
128
  # Pass arguments to `list_operations` via a request object, either of type
134
129
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -191,10 +186,11 @@ module Google
191
186
  # Customize the options with defaults
192
187
  metadata = @config.rpcs.list_operations.metadata.to_h
193
188
 
194
- # Set x-goog-api-client and x-goog-user-project headers
189
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
195
190
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
196
191
  lib_name: @config.lib_name, lib_version: @config.lib_version,
197
192
  gapic_version: ::Google::Cloud::Metastore::V1beta::VERSION
193
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
198
194
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
199
195
 
200
196
  header_params = {}
@@ -217,7 +213,7 @@ module Google
217
213
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
218
214
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
219
215
  yield response, operation if block_given?
220
- return response
216
+ throw :response, response
221
217
  end
222
218
  rescue ::GRPC::BadStatus => e
223
219
  raise ::Google::Cloud::Error.from_error(e)
@@ -287,10 +283,11 @@ module Google
287
283
  # Customize the options with defaults
288
284
  metadata = @config.rpcs.get_operation.metadata.to_h
289
285
 
290
- # Set x-goog-api-client and x-goog-user-project headers
286
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
291
287
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
292
288
  lib_name: @config.lib_name, lib_version: @config.lib_version,
293
289
  gapic_version: ::Google::Cloud::Metastore::V1beta::VERSION
290
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
294
291
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
295
292
 
296
293
  header_params = {}
@@ -312,7 +309,7 @@ module Google
312
309
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
313
310
  response = ::Gapic::Operation.new response, @operations_client, options: options
314
311
  yield response, operation if block_given?
315
- return response
312
+ throw :response, response
316
313
  end
317
314
  rescue ::GRPC::BadStatus => e
318
315
  raise ::Google::Cloud::Error.from_error(e)
@@ -376,10 +373,11 @@ module Google
376
373
  # Customize the options with defaults
377
374
  metadata = @config.rpcs.delete_operation.metadata.to_h
378
375
 
379
- # Set x-goog-api-client and x-goog-user-project headers
376
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
380
377
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
381
378
  lib_name: @config.lib_name, lib_version: @config.lib_version,
382
379
  gapic_version: ::Google::Cloud::Metastore::V1beta::VERSION
380
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
383
381
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
384
382
 
385
383
  header_params = {}
@@ -400,7 +398,6 @@ module Google
400
398
 
401
399
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
402
400
  yield response, operation if block_given?
403
- return response
404
401
  end
405
402
  rescue ::GRPC::BadStatus => e
406
403
  raise ::Google::Cloud::Error.from_error(e)
@@ -415,8 +412,9 @@ module Google
415
412
  # other methods to check whether the cancellation succeeded or whether the
416
413
  # operation completed despite cancellation. On successful cancellation,
417
414
  # the operation is not deleted; instead, it becomes an operation with
418
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
419
- # corresponding to `Code.CANCELLED`.
415
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
416
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
417
+ # `Code.CANCELLED`.
420
418
  #
421
419
  # @overload cancel_operation(request, options = nil)
422
420
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -470,10 +468,11 @@ module Google
470
468
  # Customize the options with defaults
471
469
  metadata = @config.rpcs.cancel_operation.metadata.to_h
472
470
 
473
- # Set x-goog-api-client and x-goog-user-project headers
471
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
474
472
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
475
473
  lib_name: @config.lib_name, lib_version: @config.lib_version,
476
474
  gapic_version: ::Google::Cloud::Metastore::V1beta::VERSION
475
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
477
476
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
478
477
 
479
478
  header_params = {}
@@ -494,7 +493,6 @@ module Google
494
493
 
495
494
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
496
495
  yield response, operation if block_given?
497
- return response
498
496
  end
499
497
  rescue ::GRPC::BadStatus => e
500
498
  raise ::Google::Cloud::Error.from_error(e)
@@ -574,10 +572,11 @@ module Google
574
572
  # Customize the options with defaults
575
573
  metadata = @config.rpcs.wait_operation.metadata.to_h
576
574
 
577
- # Set x-goog-api-client and x-goog-user-project headers
575
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
578
576
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
579
577
  lib_name: @config.lib_name, lib_version: @config.lib_version,
580
578
  gapic_version: ::Google::Cloud::Metastore::V1beta::VERSION
579
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
581
580
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
582
581
 
583
582
  options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
@@ -591,7 +590,7 @@ module Google
591
590
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
592
591
  response = ::Gapic::Operation.new response, @operations_client, options: options
593
592
  yield response, operation if block_given?
594
- return response
593
+ throw :response, response
595
594
  end
596
595
  rescue ::GRPC::BadStatus => e
597
596
  raise ::Google::Cloud::Error.from_error(e)
@@ -680,6 +679,11 @@ module Google
680
679
  # default endpoint URL. The default value of nil uses the environment
681
680
  # universe (usually the default "googleapis.com" universe).
682
681
  # @return [::String,nil]
682
+ # @!attribute [rw] logger
683
+ # A custom logger to use for request/response debug logging, or the value
684
+ # `:default` (the default) to construct a default logger, or `nil` to
685
+ # explicitly disable logging.
686
+ # @return [::Logger,:default,nil]
683
687
  #
684
688
  class Configuration
685
689
  extend ::Gapic::Config
@@ -704,6 +708,7 @@ module Google
704
708
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
705
709
  config_attr :quota_project, nil, ::String, nil
706
710
  config_attr :universe_domain, nil, ::String, nil
711
+ config_attr :logger, :default, ::Logger, nil, :default
707
712
 
708
713
  # @private
709
714
  def initialize parent_config = nil
@@ -46,6 +46,9 @@ module Google
46
46
  # `projects/{project_number}/locations/{location_id}/federations/{federation_id}`.
47
47
  #
48
48
  class Client
49
+ # @private
50
+ API_VERSION = ""
51
+
49
52
  # @private
50
53
  DEFAULT_ENDPOINT_TEMPLATE = "metastore.$UNIVERSE_DOMAIN$"
51
54
 
@@ -168,15 +171,27 @@ module Google
168
171
  endpoint: @config.endpoint,
169
172
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
170
173
  universe_domain: @config.universe_domain,
171
- credentials: credentials
174
+ credentials: credentials,
175
+ logger: @config.logger
172
176
  )
173
177
 
178
+ @dataproc_metastore_federation_stub.logger(stub: true)&.info do |entry|
179
+ entry.set_system_name
180
+ entry.set_service
181
+ entry.message = "Created client for #{entry.service}"
182
+ entry.set_credentials_fields credentials
183
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
184
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
185
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
186
+ end
187
+
174
188
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
175
189
  config.credentials = credentials
176
190
  config.quota_project = @quota_project_id
177
191
  config.endpoint = @dataproc_metastore_federation_stub.endpoint
178
192
  config.universe_domain = @dataproc_metastore_federation_stub.universe_domain
179
193
  config.bindings_override = @config.bindings_override
194
+ config.logger = @dataproc_metastore_federation_stub.logger if config.respond_to? :logger=
180
195
  end
181
196
 
182
197
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
@@ -185,6 +200,7 @@ module Google
185
200
  config.endpoint = @dataproc_metastore_federation_stub.endpoint
186
201
  config.universe_domain = @dataproc_metastore_federation_stub.universe_domain
187
202
  config.bindings_override = @config.bindings_override
203
+ config.logger = @dataproc_metastore_federation_stub.logger if config.respond_to? :logger=
188
204
  end
189
205
  end
190
206
 
@@ -209,6 +225,15 @@ module Google
209
225
  #
210
226
  attr_reader :iam_policy_client
211
227
 
228
+ ##
229
+ # The logger used for request/response debug logging.
230
+ #
231
+ # @return [Logger]
232
+ #
233
+ def logger
234
+ @dataproc_metastore_federation_stub.logger
235
+ end
236
+
212
237
  # Service calls
213
238
 
214
239
  ##
@@ -291,12 +316,13 @@ module Google
291
316
  # Customize the options with defaults
292
317
  call_metadata = @config.rpcs.list_federations.metadata.to_h
293
318
 
294
- # Set x-goog-api-client and x-goog-user-project headers
319
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
295
320
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
296
321
  lib_name: @config.lib_name, lib_version: @config.lib_version,
297
322
  gapic_version: ::Google::Cloud::Metastore::V1beta::VERSION,
298
323
  transports_version_send: [:rest]
299
324
 
325
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
300
326
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
301
327
 
302
328
  options.apply_defaults timeout: @config.rpcs.list_federations.timeout,
@@ -309,7 +335,6 @@ module Google
309
335
 
310
336
  @dataproc_metastore_federation_stub.list_federations request, options do |result, operation|
311
337
  yield result, operation if block_given?
312
- return result
313
338
  end
314
339
  rescue ::Gapic::Rest::Error => e
315
340
  raise ::Google::Cloud::Error.from_error(e)
@@ -372,12 +397,13 @@ module Google
372
397
  # Customize the options with defaults
373
398
  call_metadata = @config.rpcs.get_federation.metadata.to_h
374
399
 
375
- # Set x-goog-api-client and x-goog-user-project headers
400
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
376
401
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
377
402
  lib_name: @config.lib_name, lib_version: @config.lib_version,
378
403
  gapic_version: ::Google::Cloud::Metastore::V1beta::VERSION,
379
404
  transports_version_send: [:rest]
380
405
 
406
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
381
407
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
382
408
 
383
409
  options.apply_defaults timeout: @config.rpcs.get_federation.timeout,
@@ -390,7 +416,6 @@ module Google
390
416
 
391
417
  @dataproc_metastore_federation_stub.get_federation request, options do |result, operation|
392
418
  yield result, operation if block_given?
393
- return result
394
419
  end
395
420
  rescue ::Gapic::Rest::Error => e
396
421
  raise ::Google::Cloud::Error.from_error(e)
@@ -484,12 +509,13 @@ module Google
484
509
  # Customize the options with defaults
485
510
  call_metadata = @config.rpcs.create_federation.metadata.to_h
486
511
 
487
- # Set x-goog-api-client and x-goog-user-project headers
512
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
488
513
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
489
514
  lib_name: @config.lib_name, lib_version: @config.lib_version,
490
515
  gapic_version: ::Google::Cloud::Metastore::V1beta::VERSION,
491
516
  transports_version_send: [:rest]
492
517
 
518
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
493
519
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
494
520
 
495
521
  options.apply_defaults timeout: @config.rpcs.create_federation.timeout,
@@ -503,7 +529,7 @@ module Google
503
529
  @dataproc_metastore_federation_stub.create_federation request, options do |result, operation|
504
530
  result = ::Gapic::Operation.new result, @operations_client, options: options
505
531
  yield result, operation if block_given?
506
- return result
532
+ throw :response, result
507
533
  end
508
534
  rescue ::Gapic::Rest::Error => e
509
535
  raise ::Google::Cloud::Error.from_error(e)
@@ -592,12 +618,13 @@ module Google
592
618
  # Customize the options with defaults
593
619
  call_metadata = @config.rpcs.update_federation.metadata.to_h
594
620
 
595
- # Set x-goog-api-client and x-goog-user-project headers
621
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
596
622
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
597
623
  lib_name: @config.lib_name, lib_version: @config.lib_version,
598
624
  gapic_version: ::Google::Cloud::Metastore::V1beta::VERSION,
599
625
  transports_version_send: [:rest]
600
626
 
627
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
601
628
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
602
629
 
603
630
  options.apply_defaults timeout: @config.rpcs.update_federation.timeout,
@@ -611,7 +638,7 @@ module Google
611
638
  @dataproc_metastore_federation_stub.update_federation request, options do |result, operation|
612
639
  result = ::Gapic::Operation.new result, @operations_client, options: options
613
640
  yield result, operation if block_given?
614
- return result
641
+ throw :response, result
615
642
  end
616
643
  rescue ::Gapic::Rest::Error => e
617
644
  raise ::Google::Cloud::Error.from_error(e)
@@ -694,12 +721,13 @@ module Google
694
721
  # Customize the options with defaults
695
722
  call_metadata = @config.rpcs.delete_federation.metadata.to_h
696
723
 
697
- # Set x-goog-api-client and x-goog-user-project headers
724
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
698
725
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
699
726
  lib_name: @config.lib_name, lib_version: @config.lib_version,
700
727
  gapic_version: ::Google::Cloud::Metastore::V1beta::VERSION,
701
728
  transports_version_send: [:rest]
702
729
 
730
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
703
731
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
704
732
 
705
733
  options.apply_defaults timeout: @config.rpcs.delete_federation.timeout,
@@ -713,7 +741,7 @@ module Google
713
741
  @dataproc_metastore_federation_stub.delete_federation request, options do |result, operation|
714
742
  result = ::Gapic::Operation.new result, @operations_client, options: options
715
743
  yield result, operation if block_given?
716
- return result
744
+ throw :response, result
717
745
  end
718
746
  rescue ::Gapic::Rest::Error => e
719
747
  raise ::Google::Cloud::Error.from_error(e)
@@ -793,6 +821,11 @@ module Google
793
821
  # default endpoint URL. The default value of nil uses the environment
794
822
  # universe (usually the default "googleapis.com" universe).
795
823
  # @return [::String,nil]
824
+ # @!attribute [rw] logger
825
+ # A custom logger to use for request/response debug logging, or the value
826
+ # `:default` (the default) to construct a default logger, or `nil` to
827
+ # explicitly disable logging.
828
+ # @return [::Logger,:default,nil]
796
829
  #
797
830
  class Configuration
798
831
  extend ::Gapic::Config
@@ -821,6 +854,7 @@ module Google
821
854
  # by the host service.
822
855
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
823
856
  config_attr :bindings_override, {}, ::Hash, nil
857
+ config_attr :logger, :default, ::Logger, nil, :default
824
858
 
825
859
  # @private
826
860
  def initialize parent_config = nil