google-cloud-notebooks-v1 0.9.1 → 0.11.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: 55e21180347092727855c968df353dcac987ccadc44ad1821baa85f26a04f960
4
- data.tar.gz: 7b1a0e5f0e1aad4aab6664c1fe907e9a8704e76662d99f8e7dafb5c7168f2a9e
3
+ metadata.gz: 538bd8d92c017233eb96d34a16602809d8aea6ca2d6f99b1104f44104d763add
4
+ data.tar.gz: 3ee928e6bfe4d9fbc5681e53ad58124aa828c80c76f4091b4a4e0d668dc67eca
5
5
  SHA512:
6
- metadata.gz: 59bffb7b7344d44e8b09ec4ef4ad301d5e173f548d43116a669ddbc67a503b187dd7e5b4721eeb95085c6f0b562aac7aeb3d5cd8c5422e20b67d8ee8d06d8c2a
7
- data.tar.gz: 0a9ef15955a1db65cd6e1065d053662cd0c38b97c7dfcb14e1801ba580bc240c1554798f6bfa03eb03ef5d49dda66518e871df03e03952a96885032148326d5c
6
+ metadata.gz: 9d41c5cac2a312be770acfab84bc964b6b224b7bf3f6b90656d23d3a25c4a3ae3bcfa59e2007e3f2c2b1cdd838bd741f48964156be707ee2e5d2772e8f2a6da6
7
+ data.tar.gz: 76bdb238556d1fa73acad2c0c4d74441d8bf09780516ad46773c8e4d1ecb7bc8a376c566fc9c729c9e51a8c53c1d3e0047a260a67df36ad26306bb94f8882112
data/README.md CHANGED
@@ -43,40 +43,50 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/ai-platform-notebooks)
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/notebooks/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::Notebooks::V1::ManagedNotebookService::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).
76
86
 
77
87
  ## Supported Ruby Versions
78
88
 
79
- This library is supported on Ruby 2.7+.
89
+ This library is supported on Ruby 3.0+.
80
90
 
81
91
  Google provides official support for Ruby versions that are actively supported
82
92
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -191,14 +191,26 @@ module Google
191
191
  universe_domain: @config.universe_domain,
192
192
  channel_args: @config.channel_args,
193
193
  interceptors: @config.interceptors,
194
- channel_pool_config: @config.channel_pool
194
+ channel_pool_config: @config.channel_pool,
195
+ logger: @config.logger
195
196
  )
196
197
 
198
+ @managed_notebook_service_stub.stub_logger&.info do |entry|
199
+ entry.set_system_name
200
+ entry.set_service
201
+ entry.message = "Created client for #{entry.service}"
202
+ entry.set_credentials_fields credentials
203
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
204
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
205
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
206
+ end
207
+
197
208
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
198
209
  config.credentials = credentials
199
210
  config.quota_project = @quota_project_id
200
211
  config.endpoint = @managed_notebook_service_stub.endpoint
201
212
  config.universe_domain = @managed_notebook_service_stub.universe_domain
213
+ config.logger = @managed_notebook_service_stub.logger if config.respond_to? :logger=
202
214
  end
203
215
 
204
216
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
@@ -206,6 +218,7 @@ module Google
206
218
  config.quota_project = @quota_project_id
207
219
  config.endpoint = @managed_notebook_service_stub.endpoint
208
220
  config.universe_domain = @managed_notebook_service_stub.universe_domain
221
+ config.logger = @managed_notebook_service_stub.logger if config.respond_to? :logger=
209
222
  end
210
223
  end
211
224
 
@@ -230,6 +243,15 @@ module Google
230
243
  #
231
244
  attr_reader :iam_policy_client
232
245
 
246
+ ##
247
+ # The logger used for request/response debug logging.
248
+ #
249
+ # @return [Logger]
250
+ #
251
+ def logger
252
+ @managed_notebook_service_stub.logger
253
+ end
254
+
233
255
  # Service calls
234
256
 
235
257
  ##
@@ -323,7 +345,7 @@ module Google
323
345
  @managed_notebook_service_stub.call_rpc :list_runtimes, request, options: options do |response, operation|
324
346
  response = ::Gapic::PagedEnumerable.new @managed_notebook_service_stub, :list_runtimes, request, response, operation, options
325
347
  yield response, operation if block_given?
326
- return response
348
+ throw :response, response
327
349
  end
328
350
  rescue ::GRPC::BadStatus => e
329
351
  raise ::Google::Cloud::Error.from_error(e)
@@ -411,7 +433,6 @@ module Google
411
433
 
412
434
  @managed_notebook_service_stub.call_rpc :get_runtime, request, options: options do |response, operation|
413
435
  yield response, operation if block_given?
414
- return response
415
436
  end
416
437
  rescue ::GRPC::BadStatus => e
417
438
  raise ::Google::Cloud::Error.from_error(e)
@@ -512,7 +533,7 @@ module Google
512
533
  @managed_notebook_service_stub.call_rpc :create_runtime, request, options: options do |response, operation|
513
534
  response = ::Gapic::Operation.new response, @operations_client, options: options
514
535
  yield response, operation if block_given?
515
- return response
536
+ throw :response, response
516
537
  end
517
538
  rescue ::GRPC::BadStatus => e
518
539
  raise ::Google::Cloud::Error.from_error(e)
@@ -632,7 +653,7 @@ module Google
632
653
  @managed_notebook_service_stub.call_rpc :update_runtime, request, options: options do |response, operation|
633
654
  response = ::Gapic::Operation.new response, @operations_client, options: options
634
655
  yield response, operation if block_given?
635
- return response
656
+ throw :response, response
636
657
  end
637
658
  rescue ::GRPC::BadStatus => e
638
659
  raise ::Google::Cloud::Error.from_error(e)
@@ -729,7 +750,7 @@ module Google
729
750
  @managed_notebook_service_stub.call_rpc :delete_runtime, request, options: options do |response, operation|
730
751
  response = ::Gapic::Operation.new response, @operations_client, options: options
731
752
  yield response, operation if block_given?
732
- return response
753
+ throw :response, response
733
754
  end
734
755
  rescue ::GRPC::BadStatus => e
735
756
  raise ::Google::Cloud::Error.from_error(e)
@@ -830,7 +851,7 @@ module Google
830
851
  @managed_notebook_service_stub.call_rpc :start_runtime, request, options: options do |response, operation|
831
852
  response = ::Gapic::Operation.new response, @operations_client, options: options
832
853
  yield response, operation if block_given?
833
- return response
854
+ throw :response, response
834
855
  end
835
856
  rescue ::GRPC::BadStatus => e
836
857
  raise ::Google::Cloud::Error.from_error(e)
@@ -931,7 +952,7 @@ module Google
931
952
  @managed_notebook_service_stub.call_rpc :stop_runtime, request, options: options do |response, operation|
932
953
  response = ::Gapic::Operation.new response, @operations_client, options: options
933
954
  yield response, operation if block_given?
934
- return response
955
+ throw :response, response
935
956
  end
936
957
  rescue ::GRPC::BadStatus => e
937
958
  raise ::Google::Cloud::Error.from_error(e)
@@ -1032,7 +1053,7 @@ module Google
1032
1053
  @managed_notebook_service_stub.call_rpc :switch_runtime, request, options: options do |response, operation|
1033
1054
  response = ::Gapic::Operation.new response, @operations_client, options: options
1034
1055
  yield response, operation if block_given?
1035
- return response
1056
+ throw :response, response
1036
1057
  end
1037
1058
  rescue ::GRPC::BadStatus => e
1038
1059
  raise ::Google::Cloud::Error.from_error(e)
@@ -1129,7 +1150,7 @@ module Google
1129
1150
  @managed_notebook_service_stub.call_rpc :reset_runtime, request, options: options do |response, operation|
1130
1151
  response = ::Gapic::Operation.new response, @operations_client, options: options
1131
1152
  yield response, operation if block_given?
1132
- return response
1153
+ throw :response, response
1133
1154
  end
1134
1155
  rescue ::GRPC::BadStatus => e
1135
1156
  raise ::Google::Cloud::Error.from_error(e)
@@ -1226,7 +1247,7 @@ module Google
1226
1247
  @managed_notebook_service_stub.call_rpc :upgrade_runtime, request, options: options do |response, operation|
1227
1248
  response = ::Gapic::Operation.new response, @operations_client, options: options
1228
1249
  yield response, operation if block_given?
1229
- return response
1250
+ throw :response, response
1230
1251
  end
1231
1252
  rescue ::GRPC::BadStatus => e
1232
1253
  raise ::Google::Cloud::Error.from_error(e)
@@ -1326,7 +1347,7 @@ module Google
1326
1347
  @managed_notebook_service_stub.call_rpc :report_runtime_event, request, options: options do |response, operation|
1327
1348
  response = ::Gapic::Operation.new response, @operations_client, options: options
1328
1349
  yield response, operation if block_given?
1329
- return response
1350
+ throw :response, response
1330
1351
  end
1331
1352
  rescue ::GRPC::BadStatus => e
1332
1353
  raise ::Google::Cloud::Error.from_error(e)
@@ -1417,7 +1438,6 @@ module Google
1417
1438
 
1418
1439
  @managed_notebook_service_stub.call_rpc :refresh_runtime_token_internal, request, options: options do |response, operation|
1419
1440
  yield response, operation if block_given?
1420
- return response
1421
1441
  end
1422
1442
  rescue ::GRPC::BadStatus => e
1423
1443
  raise ::Google::Cloud::Error.from_error(e)
@@ -1514,7 +1534,7 @@ module Google
1514
1534
  @managed_notebook_service_stub.call_rpc :diagnose_runtime, request, options: options do |response, operation|
1515
1535
  response = ::Gapic::Operation.new response, @operations_client, options: options
1516
1536
  yield response, operation if block_given?
1517
- return response
1537
+ throw :response, response
1518
1538
  end
1519
1539
  rescue ::GRPC::BadStatus => e
1520
1540
  raise ::Google::Cloud::Error.from_error(e)
@@ -1564,6 +1584,13 @@ module Google
1564
1584
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1565
1585
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1566
1586
  # * (`nil`) indicating no credentials
1587
+ #
1588
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1589
+ # external source for authentication to Google Cloud, you must validate it before
1590
+ # providing it to a Google API client library. Providing an unvalidated credential
1591
+ # configuration to Google APIs can compromise the security of your systems and data.
1592
+ # For more information, refer to [Validate credential configurations from external
1593
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1567
1594
  # @return [::Object]
1568
1595
  # @!attribute [rw] scope
1569
1596
  # The OAuth scopes
@@ -1603,6 +1630,11 @@ module Google
1603
1630
  # default endpoint URL. The default value of nil uses the environment
1604
1631
  # universe (usually the default "googleapis.com" universe).
1605
1632
  # @return [::String,nil]
1633
+ # @!attribute [rw] logger
1634
+ # A custom logger to use for request/response debug logging, or the value
1635
+ # `:default` (the default) to construct a default logger, or `nil` to
1636
+ # explicitly disable logging.
1637
+ # @return [::Logger,:default,nil]
1606
1638
  #
1607
1639
  class Configuration
1608
1640
  extend ::Gapic::Config
@@ -1627,6 +1659,7 @@ module Google
1627
1659
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1628
1660
  config_attr :quota_project, nil, ::String, nil
1629
1661
  config_attr :universe_domain, nil, ::String, nil
1662
+ config_attr :logger, :default, ::Logger, nil, :default
1630
1663
 
1631
1664
  # @private
1632
1665
  def initialize parent_config = nil
@@ -124,14 +124,6 @@ module Google
124
124
  # Lists operations that match the specified filter in the request. If the
125
125
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
126
126
  #
127
- # NOTE: the `name` binding allows API services to override the binding
128
- # to use different resource name schemes, such as `users/*/operations`. To
129
- # override the binding, API services can add a binding such as
130
- # `"/v1/{name=users/*}/operations"` to their service configuration.
131
- # For backwards compatibility, the default name includes the operations
132
- # collection id, however overriding users must ensure the name binding
133
- # is the parent resource, without the operations collection id.
134
- #
135
127
  # @overload list_operations(request, options = nil)
136
128
  # Pass arguments to `list_operations` via a request object, either of type
137
129
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -221,7 +213,7 @@ module Google
221
213
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
222
214
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
223
215
  yield response, operation if block_given?
224
- return response
216
+ throw :response, response
225
217
  end
226
218
  rescue ::GRPC::BadStatus => e
227
219
  raise ::Google::Cloud::Error.from_error(e)
@@ -317,7 +309,7 @@ module Google
317
309
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
318
310
  response = ::Gapic::Operation.new response, @operations_client, options: options
319
311
  yield response, operation if block_given?
320
- return response
312
+ throw :response, response
321
313
  end
322
314
  rescue ::GRPC::BadStatus => e
323
315
  raise ::Google::Cloud::Error.from_error(e)
@@ -406,7 +398,6 @@ module Google
406
398
 
407
399
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
408
400
  yield response, operation if block_given?
409
- return response
410
401
  end
411
402
  rescue ::GRPC::BadStatus => e
412
403
  raise ::Google::Cloud::Error.from_error(e)
@@ -421,8 +412,9 @@ module Google
421
412
  # other methods to check whether the cancellation succeeded or whether the
422
413
  # operation completed despite cancellation. On successful cancellation,
423
414
  # the operation is not deleted; instead, it becomes an operation with
424
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
425
- # 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`.
426
418
  #
427
419
  # @overload cancel_operation(request, options = nil)
428
420
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -501,7 +493,6 @@ module Google
501
493
 
502
494
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
503
495
  yield response, operation if block_given?
504
- return response
505
496
  end
506
497
  rescue ::GRPC::BadStatus => e
507
498
  raise ::Google::Cloud::Error.from_error(e)
@@ -599,7 +590,7 @@ module Google
599
590
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
600
591
  response = ::Gapic::Operation.new response, @operations_client, options: options
601
592
  yield response, operation if block_given?
602
- return response
593
+ throw :response, response
603
594
  end
604
595
  rescue ::GRPC::BadStatus => e
605
596
  raise ::Google::Cloud::Error.from_error(e)
@@ -649,6 +640,13 @@ module Google
649
640
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
650
641
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
651
642
  # * (`nil`) indicating no credentials
643
+ #
644
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
645
+ # external source for authentication to Google Cloud, you must validate it before
646
+ # providing it to a Google API client library. Providing an unvalidated credential
647
+ # configuration to Google APIs can compromise the security of your systems and data.
648
+ # For more information, refer to [Validate credential configurations from external
649
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
652
650
  # @return [::Object]
653
651
  # @!attribute [rw] scope
654
652
  # The OAuth scopes
@@ -688,6 +686,11 @@ module Google
688
686
  # default endpoint URL. The default value of nil uses the environment
689
687
  # universe (usually the default "googleapis.com" universe).
690
688
  # @return [::String,nil]
689
+ # @!attribute [rw] logger
690
+ # A custom logger to use for request/response debug logging, or the value
691
+ # `:default` (the default) to construct a default logger, or `nil` to
692
+ # explicitly disable logging.
693
+ # @return [::Logger,:default,nil]
691
694
  #
692
695
  class Configuration
693
696
  extend ::Gapic::Config
@@ -712,6 +715,7 @@ module Google
712
715
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
713
716
  config_attr :quota_project, nil, ::String, nil
714
717
  config_attr :universe_domain, nil, ::String, nil
718
+ config_attr :logger, :default, ::Logger, nil, :default
715
719
 
716
720
  # @private
717
721
  def initialize parent_config = nil
@@ -184,15 +184,27 @@ module Google
184
184
  endpoint: @config.endpoint,
185
185
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
186
186
  universe_domain: @config.universe_domain,
187
- credentials: credentials
187
+ credentials: credentials,
188
+ logger: @config.logger
188
189
  )
189
190
 
191
+ @managed_notebook_service_stub.logger(stub: true)&.info do |entry|
192
+ entry.set_system_name
193
+ entry.set_service
194
+ entry.message = "Created client for #{entry.service}"
195
+ entry.set_credentials_fields credentials
196
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
197
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
198
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
199
+ end
200
+
190
201
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
191
202
  config.credentials = credentials
192
203
  config.quota_project = @quota_project_id
193
204
  config.endpoint = @managed_notebook_service_stub.endpoint
194
205
  config.universe_domain = @managed_notebook_service_stub.universe_domain
195
206
  config.bindings_override = @config.bindings_override
207
+ config.logger = @managed_notebook_service_stub.logger if config.respond_to? :logger=
196
208
  end
197
209
 
198
210
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
@@ -201,6 +213,7 @@ module Google
201
213
  config.endpoint = @managed_notebook_service_stub.endpoint
202
214
  config.universe_domain = @managed_notebook_service_stub.universe_domain
203
215
  config.bindings_override = @config.bindings_override
216
+ config.logger = @managed_notebook_service_stub.logger if config.respond_to? :logger=
204
217
  end
205
218
  end
206
219
 
@@ -225,6 +238,15 @@ module Google
225
238
  #
226
239
  attr_reader :iam_policy_client
227
240
 
241
+ ##
242
+ # The logger used for request/response debug logging.
243
+ #
244
+ # @return [Logger]
245
+ #
246
+ def logger
247
+ @managed_notebook_service_stub.logger
248
+ end
249
+
228
250
  # Service calls
229
251
 
230
252
  ##
@@ -310,7 +332,6 @@ module Google
310
332
 
311
333
  @managed_notebook_service_stub.list_runtimes request, options do |result, operation|
312
334
  yield result, operation if block_given?
313
- return result
314
335
  end
315
336
  rescue ::Gapic::Rest::Error => e
316
337
  raise ::Google::Cloud::Error.from_error(e)
@@ -391,7 +412,6 @@ module Google
391
412
 
392
413
  @managed_notebook_service_stub.get_runtime request, options do |result, operation|
393
414
  yield result, operation if block_given?
394
- return result
395
415
  end
396
416
  rescue ::Gapic::Rest::Error => e
397
417
  raise ::Google::Cloud::Error.from_error(e)
@@ -485,7 +505,7 @@ module Google
485
505
  @managed_notebook_service_stub.create_runtime request, options do |result, operation|
486
506
  result = ::Gapic::Operation.new result, @operations_client, options: options
487
507
  yield result, operation if block_given?
488
- return result
508
+ throw :response, result
489
509
  end
490
510
  rescue ::Gapic::Rest::Error => e
491
511
  raise ::Google::Cloud::Error.from_error(e)
@@ -598,7 +618,7 @@ module Google
598
618
  @managed_notebook_service_stub.update_runtime request, options do |result, operation|
599
619
  result = ::Gapic::Operation.new result, @operations_client, options: options
600
620
  yield result, operation if block_given?
601
- return result
621
+ throw :response, result
602
622
  end
603
623
  rescue ::Gapic::Rest::Error => e
604
624
  raise ::Google::Cloud::Error.from_error(e)
@@ -688,7 +708,7 @@ module Google
688
708
  @managed_notebook_service_stub.delete_runtime request, options do |result, operation|
689
709
  result = ::Gapic::Operation.new result, @operations_client, options: options
690
710
  yield result, operation if block_given?
691
- return result
711
+ throw :response, result
692
712
  end
693
713
  rescue ::Gapic::Rest::Error => e
694
714
  raise ::Google::Cloud::Error.from_error(e)
@@ -782,7 +802,7 @@ module Google
782
802
  @managed_notebook_service_stub.start_runtime request, options do |result, operation|
783
803
  result = ::Gapic::Operation.new result, @operations_client, options: options
784
804
  yield result, operation if block_given?
785
- return result
805
+ throw :response, result
786
806
  end
787
807
  rescue ::Gapic::Rest::Error => e
788
808
  raise ::Google::Cloud::Error.from_error(e)
@@ -876,7 +896,7 @@ module Google
876
896
  @managed_notebook_service_stub.stop_runtime request, options do |result, operation|
877
897
  result = ::Gapic::Operation.new result, @operations_client, options: options
878
898
  yield result, operation if block_given?
879
- return result
899
+ throw :response, result
880
900
  end
881
901
  rescue ::Gapic::Rest::Error => e
882
902
  raise ::Google::Cloud::Error.from_error(e)
@@ -970,7 +990,7 @@ module Google
970
990
  @managed_notebook_service_stub.switch_runtime request, options do |result, operation|
971
991
  result = ::Gapic::Operation.new result, @operations_client, options: options
972
992
  yield result, operation if block_given?
973
- return result
993
+ throw :response, result
974
994
  end
975
995
  rescue ::Gapic::Rest::Error => e
976
996
  raise ::Google::Cloud::Error.from_error(e)
@@ -1060,7 +1080,7 @@ module Google
1060
1080
  @managed_notebook_service_stub.reset_runtime request, options do |result, operation|
1061
1081
  result = ::Gapic::Operation.new result, @operations_client, options: options
1062
1082
  yield result, operation if block_given?
1063
- return result
1083
+ throw :response, result
1064
1084
  end
1065
1085
  rescue ::Gapic::Rest::Error => e
1066
1086
  raise ::Google::Cloud::Error.from_error(e)
@@ -1150,7 +1170,7 @@ module Google
1150
1170
  @managed_notebook_service_stub.upgrade_runtime request, options do |result, operation|
1151
1171
  result = ::Gapic::Operation.new result, @operations_client, options: options
1152
1172
  yield result, operation if block_given?
1153
- return result
1173
+ throw :response, result
1154
1174
  end
1155
1175
  rescue ::Gapic::Rest::Error => e
1156
1176
  raise ::Google::Cloud::Error.from_error(e)
@@ -1243,7 +1263,7 @@ module Google
1243
1263
  @managed_notebook_service_stub.report_runtime_event request, options do |result, operation|
1244
1264
  result = ::Gapic::Operation.new result, @operations_client, options: options
1245
1265
  yield result, operation if block_given?
1246
- return result
1266
+ throw :response, result
1247
1267
  end
1248
1268
  rescue ::Gapic::Rest::Error => e
1249
1269
  raise ::Google::Cloud::Error.from_error(e)
@@ -1327,7 +1347,6 @@ module Google
1327
1347
 
1328
1348
  @managed_notebook_service_stub.refresh_runtime_token_internal request, options do |result, operation|
1329
1349
  yield result, operation if block_given?
1330
- return result
1331
1350
  end
1332
1351
  rescue ::Gapic::Rest::Error => e
1333
1352
  raise ::Google::Cloud::Error.from_error(e)
@@ -1417,7 +1436,7 @@ module Google
1417
1436
  @managed_notebook_service_stub.diagnose_runtime request, options do |result, operation|
1418
1437
  result = ::Gapic::Operation.new result, @operations_client, options: options
1419
1438
  yield result, operation if block_given?
1420
- return result
1439
+ throw :response, result
1421
1440
  end
1422
1441
  rescue ::Gapic::Rest::Error => e
1423
1442
  raise ::Google::Cloud::Error.from_error(e)
@@ -1465,6 +1484,13 @@ module Google
1465
1484
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1466
1485
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1467
1486
  # * (`nil`) indicating no credentials
1487
+ #
1488
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1489
+ # external source for authentication to Google Cloud, you must validate it before
1490
+ # providing it to a Google API client library. Providing an unvalidated credential
1491
+ # configuration to Google APIs can compromise the security of your systems and data.
1492
+ # For more information, refer to [Validate credential configurations from external
1493
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1468
1494
  # @return [::Object]
1469
1495
  # @!attribute [rw] scope
1470
1496
  # The OAuth scopes
@@ -1497,6 +1523,11 @@ module Google
1497
1523
  # default endpoint URL. The default value of nil uses the environment
1498
1524
  # universe (usually the default "googleapis.com" universe).
1499
1525
  # @return [::String,nil]
1526
+ # @!attribute [rw] logger
1527
+ # A custom logger to use for request/response debug logging, or the value
1528
+ # `:default` (the default) to construct a default logger, or `nil` to
1529
+ # explicitly disable logging.
1530
+ # @return [::Logger,:default,nil]
1500
1531
  #
1501
1532
  class Configuration
1502
1533
  extend ::Gapic::Config
@@ -1525,6 +1556,7 @@ module Google
1525
1556
  # by the host service.
1526
1557
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
1527
1558
  config_attr :bindings_override, {}, ::Hash, nil
1559
+ config_attr :logger, :default, ::Logger, nil, :default
1528
1560
 
1529
1561
  # @private
1530
1562
  def initialize parent_config = nil