google-cloud-apigee_registry-v1 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eb65d194ee23d26a7794e5d09103c5cd0fd2a708719c4a812778521d3af32ecb
4
- data.tar.gz: 8819e7850979e0b3c3645c1d314048256ffabee634748cc54581d0810acd6168
3
+ metadata.gz: d015880b5c33c1ad57def4e04e44f18b0fb6888a397decd50ed0ac2716818323
4
+ data.tar.gz: aa4fd26610d20cc9d67aa3f5df63c1bd8fa718e0798692ee324599590873e4de
5
5
  SHA512:
6
- metadata.gz: 28143aa84f06a02fbc86dcedf518dd8985be20192639dd7ec8e1456bfbbf88dffcb556ff3f9eafc890b6532680be32485528895b8af47a42bc80f9911a1feaf8
7
- data.tar.gz: 04bce4d2e600c8c0a963e0075866fe8d3fb7e7982bebe09a9422ba513b8dbf517f4839e6021dc91e8dbd5cd950aef3bb3ca2b6ccfcd99af0bece8240541e668a
6
+ metadata.gz: 3e7764e61d51c1119d0e757279cfe7714d2a5038d27af7354df4a9ea59dee9ffa4b92f0dca84c822d0e90cda285e3f316b5354e33df56f47d721f83abe7f03d0
7
+ data.tar.gz: 0a468f708d5344c0a4384218a3e5eaf770c036a36a795da5fec33a35cc001f960ea1f68d114cb4735a2f6e87ee82acfb63dd12577cdc3299477d55f90082f816
data/README.md CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/apigee/docs/api-hub/get-started-registry-api/)
44
44
  for general usage information.
45
45
 
46
- ## Enabling Logging
47
-
48
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
- that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
-
54
- Configuring a Ruby stdlib logger:
46
+ ## Debug Logging
47
+
48
+ This library comes with opt-in Debug Logging that can help you troubleshoot
49
+ your application's integration with the API. When logging is activated, key
50
+ events such as requests and responses, along with data payloads and metadata
51
+ such as headers and client configuration, are logged to the standard error
52
+ stream.
53
+
54
+ **WARNING:** Client Library Debug Logging includes your data payloads in
55
+ plaintext, which could include sensitive data such as PII for yourself or your
56
+ customers, private keys, or other security data that could be compromising if
57
+ leaked. Always practice good data hygiene with your application logs, and follow
58
+ the principle of least access. Google also recommends that Client Library Debug
59
+ Logging be enabled only temporarily during active debugging, and not used
60
+ permanently in production.
61
+
62
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
63
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
64
+ list of client library gem names. This will select the default logging behavior,
65
+ which writes logs to the standard error stream. On a local workstation, this may
66
+ result in logs appearing on the console. When running on a Google Cloud hosting
67
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
68
+ results in logs appearing alongside your application logs in the
69
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
70
+
71
+ You can customize logging by modifying the `logger` configuration when
72
+ constructing a client object. For example:
55
73
 
56
74
  ```ruby
75
+ require "google/cloud/apigee_registry/v1"
57
76
  require "logger"
58
77
 
59
- module MyLogger
60
- LOGGER = Logger.new $stderr, level: Logger::WARN
61
- def logger
62
- LOGGER
63
- end
64
- end
65
-
66
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
67
- module GRPC
68
- extend MyLogger
78
+ client = ::Google::Cloud::ApigeeRegistry::V1::Provisioning::Client.new do |config|
79
+ config.logger = Logger.new "my-app.log"
69
80
  end
70
81
  ```
71
82
 
72
-
73
83
  ## Google Cloud Samples
74
84
 
75
85
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
@@ -33,6 +33,9 @@ module Google
33
33
  # Registry.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ API_VERSION = ""
38
+
36
39
  # @private
37
40
  DEFAULT_ENDPOINT_TEMPLATE = "apigeeregistry.$UNIVERSE_DOMAIN$"
38
41
 
@@ -164,14 +167,26 @@ module Google
164
167
  universe_domain: @config.universe_domain,
165
168
  channel_args: @config.channel_args,
166
169
  interceptors: @config.interceptors,
167
- channel_pool_config: @config.channel_pool
170
+ channel_pool_config: @config.channel_pool,
171
+ logger: @config.logger
168
172
  )
169
173
 
174
+ @provisioning_stub.stub_logger&.info do |entry|
175
+ entry.set_system_name
176
+ entry.set_service
177
+ entry.message = "Created client for #{entry.service}"
178
+ entry.set_credentials_fields credentials
179
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
180
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
181
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
182
+ end
183
+
170
184
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
171
185
  config.credentials = credentials
172
186
  config.quota_project = @quota_project_id
173
187
  config.endpoint = @provisioning_stub.endpoint
174
188
  config.universe_domain = @provisioning_stub.universe_domain
189
+ config.logger = @provisioning_stub.logger if config.respond_to? :logger=
175
190
  end
176
191
 
177
192
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
@@ -179,6 +194,7 @@ module Google
179
194
  config.quota_project = @quota_project_id
180
195
  config.endpoint = @provisioning_stub.endpoint
181
196
  config.universe_domain = @provisioning_stub.universe_domain
197
+ config.logger = @provisioning_stub.logger if config.respond_to? :logger=
182
198
  end
183
199
  end
184
200
 
@@ -203,6 +219,15 @@ module Google
203
219
  #
204
220
  attr_reader :iam_policy_client
205
221
 
222
+ ##
223
+ # The logger used for request/response debug logging.
224
+ #
225
+ # @return [Logger]
226
+ #
227
+ def logger
228
+ @provisioning_stub.logger
229
+ end
230
+
206
231
  # Service calls
207
232
 
208
233
  ##
@@ -272,10 +297,11 @@ module Google
272
297
  # Customize the options with defaults
273
298
  metadata = @config.rpcs.create_instance.metadata.to_h
274
299
 
275
- # Set x-goog-api-client and x-goog-user-project headers
300
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
276
301
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
277
302
  lib_name: @config.lib_name, lib_version: @config.lib_version,
278
303
  gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION
304
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
279
305
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
280
306
 
281
307
  header_params = {}
@@ -297,7 +323,7 @@ module Google
297
323
  @provisioning_stub.call_rpc :create_instance, request, options: options do |response, operation|
298
324
  response = ::Gapic::Operation.new response, @operations_client, options: options
299
325
  yield response, operation if block_given?
300
- return response
326
+ throw :response, response
301
327
  end
302
328
  rescue ::GRPC::BadStatus => e
303
329
  raise ::Google::Cloud::Error.from_error(e)
@@ -366,10 +392,11 @@ module Google
366
392
  # Customize the options with defaults
367
393
  metadata = @config.rpcs.delete_instance.metadata.to_h
368
394
 
369
- # Set x-goog-api-client and x-goog-user-project headers
395
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
370
396
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
371
397
  lib_name: @config.lib_name, lib_version: @config.lib_version,
372
398
  gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION
399
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
373
400
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
374
401
 
375
402
  header_params = {}
@@ -391,7 +418,7 @@ module Google
391
418
  @provisioning_stub.call_rpc :delete_instance, request, options: options do |response, operation|
392
419
  response = ::Gapic::Operation.new response, @operations_client, options: options
393
420
  yield response, operation if block_given?
394
- return response
421
+ throw :response, response
395
422
  end
396
423
  rescue ::GRPC::BadStatus => e
397
424
  raise ::Google::Cloud::Error.from_error(e)
@@ -453,10 +480,11 @@ module Google
453
480
  # Customize the options with defaults
454
481
  metadata = @config.rpcs.get_instance.metadata.to_h
455
482
 
456
- # Set x-goog-api-client and x-goog-user-project headers
483
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
457
484
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
458
485
  lib_name: @config.lib_name, lib_version: @config.lib_version,
459
486
  gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION
487
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
460
488
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
461
489
 
462
490
  header_params = {}
@@ -477,7 +505,6 @@ module Google
477
505
 
478
506
  @provisioning_stub.call_rpc :get_instance, request, options: options do |response, operation|
479
507
  yield response, operation if block_given?
480
- return response
481
508
  end
482
509
  rescue ::GRPC::BadStatus => e
483
510
  raise ::Google::Cloud::Error.from_error(e)
@@ -566,6 +593,11 @@ module Google
566
593
  # default endpoint URL. The default value of nil uses the environment
567
594
  # universe (usually the default "googleapis.com" universe).
568
595
  # @return [::String,nil]
596
+ # @!attribute [rw] logger
597
+ # A custom logger to use for request/response debug logging, or the value
598
+ # `:default` (the default) to construct a default logger, or `nil` to
599
+ # explicitly disable logging.
600
+ # @return [::Logger,:default,nil]
569
601
  #
570
602
  class Configuration
571
603
  extend ::Gapic::Config
@@ -590,6 +622,7 @@ module Google
590
622
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
591
623
  config_attr :quota_project, nil, ::String, nil
592
624
  config_attr :universe_domain, nil, ::String, nil
625
+ config_attr :logger, :default, ::Logger, nil, :default
593
626
 
594
627
  # @private
595
628
  def initialize parent_config = nil
@@ -26,6 +26,9 @@ module Google
26
26
  module Provisioning
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 = "apigeeregistry.$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::ApigeeRegistry::V1::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::ApigeeRegistry::V1::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::ApigeeRegistry::V1::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::ApigeeRegistry::V1::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::ApigeeRegistry::V1::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
@@ -35,6 +35,9 @@ module Google
35
35
  # Registry.
36
36
  #
37
37
  class Client
38
+ # @private
39
+ API_VERSION = ""
40
+
38
41
  # @private
39
42
  DEFAULT_ENDPOINT_TEMPLATE = "apigeeregistry.$UNIVERSE_DOMAIN$"
40
43
 
@@ -157,15 +160,27 @@ module Google
157
160
  endpoint: @config.endpoint,
158
161
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
159
162
  universe_domain: @config.universe_domain,
160
- credentials: credentials
163
+ credentials: credentials,
164
+ logger: @config.logger
161
165
  )
162
166
 
167
+ @provisioning_stub.logger(stub: true)&.info do |entry|
168
+ entry.set_system_name
169
+ entry.set_service
170
+ entry.message = "Created client for #{entry.service}"
171
+ entry.set_credentials_fields credentials
172
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
173
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
174
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
175
+ end
176
+
163
177
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
164
178
  config.credentials = credentials
165
179
  config.quota_project = @quota_project_id
166
180
  config.endpoint = @provisioning_stub.endpoint
167
181
  config.universe_domain = @provisioning_stub.universe_domain
168
182
  config.bindings_override = @config.bindings_override
183
+ config.logger = @provisioning_stub.logger if config.respond_to? :logger=
169
184
  end
170
185
 
171
186
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
@@ -174,6 +189,7 @@ module Google
174
189
  config.endpoint = @provisioning_stub.endpoint
175
190
  config.universe_domain = @provisioning_stub.universe_domain
176
191
  config.bindings_override = @config.bindings_override
192
+ config.logger = @provisioning_stub.logger if config.respond_to? :logger=
177
193
  end
178
194
  end
179
195
 
@@ -198,6 +214,15 @@ module Google
198
214
  #
199
215
  attr_reader :iam_policy_client
200
216
 
217
+ ##
218
+ # The logger used for request/response debug logging.
219
+ #
220
+ # @return [Logger]
221
+ #
222
+ def logger
223
+ @provisioning_stub.logger
224
+ end
225
+
201
226
  # Service calls
202
227
 
203
228
  ##
@@ -266,12 +291,13 @@ module Google
266
291
  # Customize the options with defaults
267
292
  call_metadata = @config.rpcs.create_instance.metadata.to_h
268
293
 
269
- # Set x-goog-api-client and x-goog-user-project headers
294
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
270
295
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
271
296
  lib_name: @config.lib_name, lib_version: @config.lib_version,
272
297
  gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
273
298
  transports_version_send: [:rest]
274
299
 
300
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
275
301
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
276
302
 
277
303
  options.apply_defaults timeout: @config.rpcs.create_instance.timeout,
@@ -285,7 +311,7 @@ module Google
285
311
  @provisioning_stub.create_instance request, options do |result, operation|
286
312
  result = ::Gapic::Operation.new result, @operations_client, options: options
287
313
  yield result, operation if block_given?
288
- return result
314
+ throw :response, result
289
315
  end
290
316
  rescue ::Gapic::Rest::Error => e
291
317
  raise ::Google::Cloud::Error.from_error(e)
@@ -353,12 +379,13 @@ module Google
353
379
  # Customize the options with defaults
354
380
  call_metadata = @config.rpcs.delete_instance.metadata.to_h
355
381
 
356
- # Set x-goog-api-client and x-goog-user-project headers
382
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
357
383
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
358
384
  lib_name: @config.lib_name, lib_version: @config.lib_version,
359
385
  gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
360
386
  transports_version_send: [:rest]
361
387
 
388
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
362
389
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
363
390
 
364
391
  options.apply_defaults timeout: @config.rpcs.delete_instance.timeout,
@@ -372,7 +399,7 @@ module Google
372
399
  @provisioning_stub.delete_instance request, options do |result, operation|
373
400
  result = ::Gapic::Operation.new result, @operations_client, options: options
374
401
  yield result, operation if block_given?
375
- return result
402
+ throw :response, result
376
403
  end
377
404
  rescue ::Gapic::Rest::Error => e
378
405
  raise ::Google::Cloud::Error.from_error(e)
@@ -433,12 +460,13 @@ module Google
433
460
  # Customize the options with defaults
434
461
  call_metadata = @config.rpcs.get_instance.metadata.to_h
435
462
 
436
- # Set x-goog-api-client and x-goog-user-project headers
463
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
437
464
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
438
465
  lib_name: @config.lib_name, lib_version: @config.lib_version,
439
466
  gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
440
467
  transports_version_send: [:rest]
441
468
 
469
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
442
470
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
443
471
 
444
472
  options.apply_defaults timeout: @config.rpcs.get_instance.timeout,
@@ -451,7 +479,6 @@ module Google
451
479
 
452
480
  @provisioning_stub.get_instance request, options do |result, operation|
453
481
  yield result, operation if block_given?
454
- return result
455
482
  end
456
483
  rescue ::Gapic::Rest::Error => e
457
484
  raise ::Google::Cloud::Error.from_error(e)
@@ -531,6 +558,11 @@ module Google
531
558
  # default endpoint URL. The default value of nil uses the environment
532
559
  # universe (usually the default "googleapis.com" universe).
533
560
  # @return [::String,nil]
561
+ # @!attribute [rw] logger
562
+ # A custom logger to use for request/response debug logging, or the value
563
+ # `:default` (the default) to construct a default logger, or `nil` to
564
+ # explicitly disable logging.
565
+ # @return [::Logger,:default,nil]
534
566
  #
535
567
  class Configuration
536
568
  extend ::Gapic::Config
@@ -559,6 +591,7 @@ module Google
559
591
  # by the host service.
560
592
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
561
593
  config_attr :bindings_override, {}, ::Hash, nil
594
+ config_attr :logger, :default, ::Logger, nil, :default
562
595
 
563
596
  # @private
564
597
  def initialize parent_config = nil