google-cloud-notebooks-v1 0.9.0 → 0.10.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.
@@ -34,6 +34,9 @@ module Google
34
34
  # API v1 service for Cloud AI Platform Notebooks.
35
35
  #
36
36
  class Client
37
+ # @private
38
+ API_VERSION = ""
39
+
37
40
  # @private
38
41
  DEFAULT_ENDPOINT_TEMPLATE = "notebooks.$UNIVERSE_DOMAIN$"
39
42
 
@@ -225,15 +228,27 @@ module Google
225
228
  endpoint: @config.endpoint,
226
229
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
227
230
  universe_domain: @config.universe_domain,
228
- credentials: credentials
231
+ credentials: credentials,
232
+ logger: @config.logger
229
233
  )
230
234
 
235
+ @notebook_service_stub.logger(stub: true)&.info do |entry|
236
+ entry.set_system_name
237
+ entry.set_service
238
+ entry.message = "Created client for #{entry.service}"
239
+ entry.set_credentials_fields credentials
240
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
241
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
242
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
243
+ end
244
+
231
245
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
232
246
  config.credentials = credentials
233
247
  config.quota_project = @quota_project_id
234
248
  config.endpoint = @notebook_service_stub.endpoint
235
249
  config.universe_domain = @notebook_service_stub.universe_domain
236
250
  config.bindings_override = @config.bindings_override
251
+ config.logger = @notebook_service_stub.logger if config.respond_to? :logger=
237
252
  end
238
253
 
239
254
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
@@ -242,6 +257,7 @@ module Google
242
257
  config.endpoint = @notebook_service_stub.endpoint
243
258
  config.universe_domain = @notebook_service_stub.universe_domain
244
259
  config.bindings_override = @config.bindings_override
260
+ config.logger = @notebook_service_stub.logger if config.respond_to? :logger=
245
261
  end
246
262
  end
247
263
 
@@ -266,6 +282,15 @@ module Google
266
282
  #
267
283
  attr_reader :iam_policy_client
268
284
 
285
+ ##
286
+ # The logger used for request/response debug logging.
287
+ #
288
+ # @return [Logger]
289
+ #
290
+ def logger
291
+ @notebook_service_stub.logger
292
+ end
293
+
269
294
  # Service calls
270
295
 
271
296
  ##
@@ -332,12 +357,13 @@ module Google
332
357
  # Customize the options with defaults
333
358
  call_metadata = @config.rpcs.list_instances.metadata.to_h
334
359
 
335
- # Set x-goog-api-client and x-goog-user-project headers
360
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
336
361
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
337
362
  lib_name: @config.lib_name, lib_version: @config.lib_version,
338
363
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
339
364
  transports_version_send: [:rest]
340
365
 
366
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
341
367
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
342
368
 
343
369
  options.apply_defaults timeout: @config.rpcs.list_instances.timeout,
@@ -350,7 +376,6 @@ module Google
350
376
 
351
377
  @notebook_service_stub.list_instances request, options do |result, operation|
352
378
  yield result, operation if block_given?
353
- return result
354
379
  end
355
380
  rescue ::Gapic::Rest::Error => e
356
381
  raise ::Google::Cloud::Error.from_error(e)
@@ -411,12 +436,13 @@ module Google
411
436
  # Customize the options with defaults
412
437
  call_metadata = @config.rpcs.get_instance.metadata.to_h
413
438
 
414
- # Set x-goog-api-client and x-goog-user-project headers
439
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
415
440
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
416
441
  lib_name: @config.lib_name, lib_version: @config.lib_version,
417
442
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
418
443
  transports_version_send: [:rest]
419
444
 
445
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
420
446
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
421
447
 
422
448
  options.apply_defaults timeout: @config.rpcs.get_instance.timeout,
@@ -429,7 +455,6 @@ module Google
429
455
 
430
456
  @notebook_service_stub.get_instance request, options do |result, operation|
431
457
  yield result, operation if block_given?
432
- return result
433
458
  end
434
459
  rescue ::Gapic::Rest::Error => e
435
460
  raise ::Google::Cloud::Error.from_error(e)
@@ -501,12 +526,13 @@ module Google
501
526
  # Customize the options with defaults
502
527
  call_metadata = @config.rpcs.create_instance.metadata.to_h
503
528
 
504
- # Set x-goog-api-client and x-goog-user-project headers
529
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
505
530
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
506
531
  lib_name: @config.lib_name, lib_version: @config.lib_version,
507
532
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
508
533
  transports_version_send: [:rest]
509
534
 
535
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
510
536
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
511
537
 
512
538
  options.apply_defaults timeout: @config.rpcs.create_instance.timeout,
@@ -520,7 +546,7 @@ module Google
520
546
  @notebook_service_stub.create_instance request, options do |result, operation|
521
547
  result = ::Gapic::Operation.new result, @operations_client, options: options
522
548
  yield result, operation if block_given?
523
- return result
549
+ throw :response, result
524
550
  end
525
551
  rescue ::Gapic::Rest::Error => e
526
552
  raise ::Google::Cloud::Error.from_error(e)
@@ -596,12 +622,13 @@ module Google
596
622
  # Customize the options with defaults
597
623
  call_metadata = @config.rpcs.register_instance.metadata.to_h
598
624
 
599
- # Set x-goog-api-client and x-goog-user-project headers
625
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
600
626
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
601
627
  lib_name: @config.lib_name, lib_version: @config.lib_version,
602
628
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
603
629
  transports_version_send: [:rest]
604
630
 
631
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
605
632
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
606
633
 
607
634
  options.apply_defaults timeout: @config.rpcs.register_instance.timeout,
@@ -615,7 +642,7 @@ module Google
615
642
  @notebook_service_stub.register_instance request, options do |result, operation|
616
643
  result = ::Gapic::Operation.new result, @operations_client, options: options
617
644
  yield result, operation if block_given?
618
- return result
645
+ throw :response, result
619
646
  end
620
647
  rescue ::Gapic::Rest::Error => e
621
648
  raise ::Google::Cloud::Error.from_error(e)
@@ -690,12 +717,13 @@ module Google
690
717
  # Customize the options with defaults
691
718
  call_metadata = @config.rpcs.set_instance_accelerator.metadata.to_h
692
719
 
693
- # Set x-goog-api-client and x-goog-user-project headers
720
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
694
721
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
695
722
  lib_name: @config.lib_name, lib_version: @config.lib_version,
696
723
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
697
724
  transports_version_send: [:rest]
698
725
 
726
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
699
727
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
700
728
 
701
729
  options.apply_defaults timeout: @config.rpcs.set_instance_accelerator.timeout,
@@ -709,7 +737,7 @@ module Google
709
737
  @notebook_service_stub.set_instance_accelerator request, options do |result, operation|
710
738
  result = ::Gapic::Operation.new result, @operations_client, options: options
711
739
  yield result, operation if block_given?
712
- return result
740
+ throw :response, result
713
741
  end
714
742
  rescue ::Gapic::Rest::Error => e
715
743
  raise ::Google::Cloud::Error.from_error(e)
@@ -780,12 +808,13 @@ module Google
780
808
  # Customize the options with defaults
781
809
  call_metadata = @config.rpcs.set_instance_machine_type.metadata.to_h
782
810
 
783
- # Set x-goog-api-client and x-goog-user-project headers
811
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
784
812
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
785
813
  lib_name: @config.lib_name, lib_version: @config.lib_version,
786
814
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
787
815
  transports_version_send: [:rest]
788
816
 
817
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
789
818
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
790
819
 
791
820
  options.apply_defaults timeout: @config.rpcs.set_instance_machine_type.timeout,
@@ -799,7 +828,7 @@ module Google
799
828
  @notebook_service_stub.set_instance_machine_type request, options do |result, operation|
800
829
  result = ::Gapic::Operation.new result, @operations_client, options: options
801
830
  yield result, operation if block_given?
802
- return result
831
+ throw :response, result
803
832
  end
804
833
  rescue ::Gapic::Rest::Error => e
805
834
  raise ::Google::Cloud::Error.from_error(e)
@@ -869,12 +898,13 @@ module Google
869
898
  # Customize the options with defaults
870
899
  call_metadata = @config.rpcs.update_instance_config.metadata.to_h
871
900
 
872
- # Set x-goog-api-client and x-goog-user-project headers
901
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
873
902
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
874
903
  lib_name: @config.lib_name, lib_version: @config.lib_version,
875
904
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
876
905
  transports_version_send: [:rest]
877
906
 
907
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
878
908
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
879
909
 
880
910
  options.apply_defaults timeout: @config.rpcs.update_instance_config.timeout,
@@ -888,7 +918,7 @@ module Google
888
918
  @notebook_service_stub.update_instance_config request, options do |result, operation|
889
919
  result = ::Gapic::Operation.new result, @operations_client, options: options
890
920
  yield result, operation if block_given?
891
- return result
921
+ throw :response, result
892
922
  end
893
923
  rescue ::Gapic::Rest::Error => e
894
924
  raise ::Google::Cloud::Error.from_error(e)
@@ -958,12 +988,13 @@ module Google
958
988
  # Customize the options with defaults
959
989
  call_metadata = @config.rpcs.update_shielded_instance_config.metadata.to_h
960
990
 
961
- # Set x-goog-api-client and x-goog-user-project headers
991
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
962
992
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
963
993
  lib_name: @config.lib_name, lib_version: @config.lib_version,
964
994
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
965
995
  transports_version_send: [:rest]
966
996
 
997
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
967
998
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
968
999
 
969
1000
  options.apply_defaults timeout: @config.rpcs.update_shielded_instance_config.timeout,
@@ -977,7 +1008,7 @@ module Google
977
1008
  @notebook_service_stub.update_shielded_instance_config request, options do |result, operation|
978
1009
  result = ::Gapic::Operation.new result, @operations_client, options: options
979
1010
  yield result, operation if block_given?
980
- return result
1011
+ throw :response, result
981
1012
  end
982
1013
  rescue ::Gapic::Rest::Error => e
983
1014
  raise ::Google::Cloud::Error.from_error(e)
@@ -1048,12 +1079,13 @@ module Google
1048
1079
  # Customize the options with defaults
1049
1080
  call_metadata = @config.rpcs.set_instance_labels.metadata.to_h
1050
1081
 
1051
- # Set x-goog-api-client and x-goog-user-project headers
1082
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1052
1083
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1053
1084
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1054
1085
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
1055
1086
  transports_version_send: [:rest]
1056
1087
 
1088
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1057
1089
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1058
1090
 
1059
1091
  options.apply_defaults timeout: @config.rpcs.set_instance_labels.timeout,
@@ -1067,7 +1099,7 @@ module Google
1067
1099
  @notebook_service_stub.set_instance_labels request, options do |result, operation|
1068
1100
  result = ::Gapic::Operation.new result, @operations_client, options: options
1069
1101
  yield result, operation if block_given?
1070
- return result
1102
+ throw :response, result
1071
1103
  end
1072
1104
  rescue ::Gapic::Rest::Error => e
1073
1105
  raise ::Google::Cloud::Error.from_error(e)
@@ -1130,12 +1162,13 @@ module Google
1130
1162
  # Customize the options with defaults
1131
1163
  call_metadata = @config.rpcs.update_instance_metadata_items.metadata.to_h
1132
1164
 
1133
- # Set x-goog-api-client and x-goog-user-project headers
1165
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1134
1166
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1135
1167
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1136
1168
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
1137
1169
  transports_version_send: [:rest]
1138
1170
 
1171
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1139
1172
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1140
1173
 
1141
1174
  options.apply_defaults timeout: @config.rpcs.update_instance_metadata_items.timeout,
@@ -1148,7 +1181,6 @@ module Google
1148
1181
 
1149
1182
  @notebook_service_stub.update_instance_metadata_items request, options do |result, operation|
1150
1183
  yield result, operation if block_given?
1151
- return result
1152
1184
  end
1153
1185
  rescue ::Gapic::Rest::Error => e
1154
1186
  raise ::Google::Cloud::Error.from_error(e)
@@ -1216,12 +1248,13 @@ module Google
1216
1248
  # Customize the options with defaults
1217
1249
  call_metadata = @config.rpcs.delete_instance.metadata.to_h
1218
1250
 
1219
- # Set x-goog-api-client and x-goog-user-project headers
1251
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1220
1252
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1221
1253
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1222
1254
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
1223
1255
  transports_version_send: [:rest]
1224
1256
 
1257
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1225
1258
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1226
1259
 
1227
1260
  options.apply_defaults timeout: @config.rpcs.delete_instance.timeout,
@@ -1235,7 +1268,7 @@ module Google
1235
1268
  @notebook_service_stub.delete_instance request, options do |result, operation|
1236
1269
  result = ::Gapic::Operation.new result, @operations_client, options: options
1237
1270
  yield result, operation if block_given?
1238
- return result
1271
+ throw :response, result
1239
1272
  end
1240
1273
  rescue ::Gapic::Rest::Error => e
1241
1274
  raise ::Google::Cloud::Error.from_error(e)
@@ -1303,12 +1336,13 @@ module Google
1303
1336
  # Customize the options with defaults
1304
1337
  call_metadata = @config.rpcs.start_instance.metadata.to_h
1305
1338
 
1306
- # Set x-goog-api-client and x-goog-user-project headers
1339
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1307
1340
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1308
1341
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1309
1342
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
1310
1343
  transports_version_send: [:rest]
1311
1344
 
1345
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1312
1346
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1313
1347
 
1314
1348
  options.apply_defaults timeout: @config.rpcs.start_instance.timeout,
@@ -1322,7 +1356,7 @@ module Google
1322
1356
  @notebook_service_stub.start_instance request, options do |result, operation|
1323
1357
  result = ::Gapic::Operation.new result, @operations_client, options: options
1324
1358
  yield result, operation if block_given?
1325
- return result
1359
+ throw :response, result
1326
1360
  end
1327
1361
  rescue ::Gapic::Rest::Error => e
1328
1362
  raise ::Google::Cloud::Error.from_error(e)
@@ -1390,12 +1424,13 @@ module Google
1390
1424
  # Customize the options with defaults
1391
1425
  call_metadata = @config.rpcs.stop_instance.metadata.to_h
1392
1426
 
1393
- # Set x-goog-api-client and x-goog-user-project headers
1427
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1394
1428
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1395
1429
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1396
1430
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
1397
1431
  transports_version_send: [:rest]
1398
1432
 
1433
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1399
1434
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1400
1435
 
1401
1436
  options.apply_defaults timeout: @config.rpcs.stop_instance.timeout,
@@ -1409,7 +1444,7 @@ module Google
1409
1444
  @notebook_service_stub.stop_instance request, options do |result, operation|
1410
1445
  result = ::Gapic::Operation.new result, @operations_client, options: options
1411
1446
  yield result, operation if block_given?
1412
- return result
1447
+ throw :response, result
1413
1448
  end
1414
1449
  rescue ::Gapic::Rest::Error => e
1415
1450
  raise ::Google::Cloud::Error.from_error(e)
@@ -1477,12 +1512,13 @@ module Google
1477
1512
  # Customize the options with defaults
1478
1513
  call_metadata = @config.rpcs.reset_instance.metadata.to_h
1479
1514
 
1480
- # Set x-goog-api-client and x-goog-user-project headers
1515
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1481
1516
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1482
1517
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1483
1518
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
1484
1519
  transports_version_send: [:rest]
1485
1520
 
1521
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1486
1522
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1487
1523
 
1488
1524
  options.apply_defaults timeout: @config.rpcs.reset_instance.timeout,
@@ -1496,7 +1532,7 @@ module Google
1496
1532
  @notebook_service_stub.reset_instance request, options do |result, operation|
1497
1533
  result = ::Gapic::Operation.new result, @operations_client, options: options
1498
1534
  yield result, operation if block_given?
1499
- return result
1535
+ throw :response, result
1500
1536
  end
1501
1537
  rescue ::Gapic::Rest::Error => e
1502
1538
  raise ::Google::Cloud::Error.from_error(e)
@@ -1573,12 +1609,13 @@ module Google
1573
1609
  # Customize the options with defaults
1574
1610
  call_metadata = @config.rpcs.report_instance_info.metadata.to_h
1575
1611
 
1576
- # Set x-goog-api-client and x-goog-user-project headers
1612
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1577
1613
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1578
1614
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1579
1615
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
1580
1616
  transports_version_send: [:rest]
1581
1617
 
1618
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1582
1619
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1583
1620
 
1584
1621
  options.apply_defaults timeout: @config.rpcs.report_instance_info.timeout,
@@ -1592,7 +1629,7 @@ module Google
1592
1629
  @notebook_service_stub.report_instance_info request, options do |result, operation|
1593
1630
  result = ::Gapic::Operation.new result, @operations_client, options: options
1594
1631
  yield result, operation if block_given?
1595
- return result
1632
+ throw :response, result
1596
1633
  end
1597
1634
  rescue ::Gapic::Rest::Error => e
1598
1635
  raise ::Google::Cloud::Error.from_error(e)
@@ -1656,12 +1693,13 @@ module Google
1656
1693
  # Customize the options with defaults
1657
1694
  call_metadata = @config.rpcs.is_instance_upgradeable.metadata.to_h
1658
1695
 
1659
- # Set x-goog-api-client and x-goog-user-project headers
1696
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1660
1697
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1661
1698
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1662
1699
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
1663
1700
  transports_version_send: [:rest]
1664
1701
 
1702
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1665
1703
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1666
1704
 
1667
1705
  options.apply_defaults timeout: @config.rpcs.is_instance_upgradeable.timeout,
@@ -1674,7 +1712,6 @@ module Google
1674
1712
 
1675
1713
  @notebook_service_stub.is_instance_upgradeable request, options do |result, operation|
1676
1714
  yield result, operation if block_given?
1677
- return result
1678
1715
  end
1679
1716
  rescue ::Gapic::Rest::Error => e
1680
1717
  raise ::Google::Cloud::Error.from_error(e)
@@ -1735,12 +1772,13 @@ module Google
1735
1772
  # Customize the options with defaults
1736
1773
  call_metadata = @config.rpcs.get_instance_health.metadata.to_h
1737
1774
 
1738
- # Set x-goog-api-client and x-goog-user-project headers
1775
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1739
1776
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1740
1777
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1741
1778
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
1742
1779
  transports_version_send: [:rest]
1743
1780
 
1781
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1744
1782
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1745
1783
 
1746
1784
  options.apply_defaults timeout: @config.rpcs.get_instance_health.timeout,
@@ -1753,7 +1791,6 @@ module Google
1753
1791
 
1754
1792
  @notebook_service_stub.get_instance_health request, options do |result, operation|
1755
1793
  yield result, operation if block_given?
1756
- return result
1757
1794
  end
1758
1795
  rescue ::Gapic::Rest::Error => e
1759
1796
  raise ::Google::Cloud::Error.from_error(e)
@@ -1824,12 +1861,13 @@ module Google
1824
1861
  # Customize the options with defaults
1825
1862
  call_metadata = @config.rpcs.upgrade_instance.metadata.to_h
1826
1863
 
1827
- # Set x-goog-api-client and x-goog-user-project headers
1864
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1828
1865
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1829
1866
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1830
1867
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
1831
1868
  transports_version_send: [:rest]
1832
1869
 
1870
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1833
1871
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1834
1872
 
1835
1873
  options.apply_defaults timeout: @config.rpcs.upgrade_instance.timeout,
@@ -1843,7 +1881,7 @@ module Google
1843
1881
  @notebook_service_stub.upgrade_instance request, options do |result, operation|
1844
1882
  result = ::Gapic::Operation.new result, @operations_client, options: options
1845
1883
  yield result, operation if block_given?
1846
- return result
1884
+ throw :response, result
1847
1885
  end
1848
1886
  rescue ::Gapic::Rest::Error => e
1849
1887
  raise ::Google::Cloud::Error.from_error(e)
@@ -1914,12 +1952,13 @@ module Google
1914
1952
  # Customize the options with defaults
1915
1953
  call_metadata = @config.rpcs.rollback_instance.metadata.to_h
1916
1954
 
1917
- # Set x-goog-api-client and x-goog-user-project headers
1955
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1918
1956
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1919
1957
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1920
1958
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
1921
1959
  transports_version_send: [:rest]
1922
1960
 
1961
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1923
1962
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1924
1963
 
1925
1964
  options.apply_defaults timeout: @config.rpcs.rollback_instance.timeout,
@@ -1933,7 +1972,7 @@ module Google
1933
1972
  @notebook_service_stub.rollback_instance request, options do |result, operation|
1934
1973
  result = ::Gapic::Operation.new result, @operations_client, options: options
1935
1974
  yield result, operation if block_given?
1936
- return result
1975
+ throw :response, result
1937
1976
  end
1938
1977
  rescue ::Gapic::Rest::Error => e
1939
1978
  raise ::Google::Cloud::Error.from_error(e)
@@ -2003,12 +2042,13 @@ module Google
2003
2042
  # Customize the options with defaults
2004
2043
  call_metadata = @config.rpcs.diagnose_instance.metadata.to_h
2005
2044
 
2006
- # Set x-goog-api-client and x-goog-user-project headers
2045
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2007
2046
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2008
2047
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2009
2048
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
2010
2049
  transports_version_send: [:rest]
2011
2050
 
2051
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2012
2052
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2013
2053
 
2014
2054
  options.apply_defaults timeout: @config.rpcs.diagnose_instance.timeout,
@@ -2022,7 +2062,7 @@ module Google
2022
2062
  @notebook_service_stub.diagnose_instance request, options do |result, operation|
2023
2063
  result = ::Gapic::Operation.new result, @operations_client, options: options
2024
2064
  yield result, operation if block_given?
2025
- return result
2065
+ throw :response, result
2026
2066
  end
2027
2067
  rescue ::Gapic::Rest::Error => e
2028
2068
  raise ::Google::Cloud::Error.from_error(e)
@@ -2097,12 +2137,13 @@ module Google
2097
2137
  # Customize the options with defaults
2098
2138
  call_metadata = @config.rpcs.upgrade_instance_internal.metadata.to_h
2099
2139
 
2100
- # Set x-goog-api-client and x-goog-user-project headers
2140
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2101
2141
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2102
2142
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2103
2143
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
2104
2144
  transports_version_send: [:rest]
2105
2145
 
2146
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2106
2147
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2107
2148
 
2108
2149
  options.apply_defaults timeout: @config.rpcs.upgrade_instance_internal.timeout,
@@ -2116,7 +2157,7 @@ module Google
2116
2157
  @notebook_service_stub.upgrade_instance_internal request, options do |result, operation|
2117
2158
  result = ::Gapic::Operation.new result, @operations_client, options: options
2118
2159
  yield result, operation if block_given?
2119
- return result
2160
+ throw :response, result
2120
2161
  end
2121
2162
  rescue ::Gapic::Rest::Error => e
2122
2163
  raise ::Google::Cloud::Error.from_error(e)
@@ -2185,12 +2226,13 @@ module Google
2185
2226
  # Customize the options with defaults
2186
2227
  call_metadata = @config.rpcs.list_environments.metadata.to_h
2187
2228
 
2188
- # Set x-goog-api-client and x-goog-user-project headers
2229
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2189
2230
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2190
2231
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2191
2232
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
2192
2233
  transports_version_send: [:rest]
2193
2234
 
2235
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2194
2236
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2195
2237
 
2196
2238
  options.apply_defaults timeout: @config.rpcs.list_environments.timeout,
@@ -2203,7 +2245,6 @@ module Google
2203
2245
 
2204
2246
  @notebook_service_stub.list_environments request, options do |result, operation|
2205
2247
  yield result, operation if block_given?
2206
- return result
2207
2248
  end
2208
2249
  rescue ::Gapic::Rest::Error => e
2209
2250
  raise ::Google::Cloud::Error.from_error(e)
@@ -2264,12 +2305,13 @@ module Google
2264
2305
  # Customize the options with defaults
2265
2306
  call_metadata = @config.rpcs.get_environment.metadata.to_h
2266
2307
 
2267
- # Set x-goog-api-client and x-goog-user-project headers
2308
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2268
2309
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2269
2310
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2270
2311
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
2271
2312
  transports_version_send: [:rest]
2272
2313
 
2314
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2273
2315
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2274
2316
 
2275
2317
  options.apply_defaults timeout: @config.rpcs.get_environment.timeout,
@@ -2282,7 +2324,6 @@ module Google
2282
2324
 
2283
2325
  @notebook_service_stub.get_environment request, options do |result, operation|
2284
2326
  yield result, operation if block_given?
2285
- return result
2286
2327
  end
2287
2328
  rescue ::Gapic::Rest::Error => e
2288
2329
  raise ::Google::Cloud::Error.from_error(e)
@@ -2356,12 +2397,13 @@ module Google
2356
2397
  # Customize the options with defaults
2357
2398
  call_metadata = @config.rpcs.create_environment.metadata.to_h
2358
2399
 
2359
- # Set x-goog-api-client and x-goog-user-project headers
2400
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2360
2401
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2361
2402
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2362
2403
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
2363
2404
  transports_version_send: [:rest]
2364
2405
 
2406
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2365
2407
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2366
2408
 
2367
2409
  options.apply_defaults timeout: @config.rpcs.create_environment.timeout,
@@ -2375,7 +2417,7 @@ module Google
2375
2417
  @notebook_service_stub.create_environment request, options do |result, operation|
2376
2418
  result = ::Gapic::Operation.new result, @operations_client, options: options
2377
2419
  yield result, operation if block_given?
2378
- return result
2420
+ throw :response, result
2379
2421
  end
2380
2422
  rescue ::Gapic::Rest::Error => e
2381
2423
  raise ::Google::Cloud::Error.from_error(e)
@@ -2443,12 +2485,13 @@ module Google
2443
2485
  # Customize the options with defaults
2444
2486
  call_metadata = @config.rpcs.delete_environment.metadata.to_h
2445
2487
 
2446
- # Set x-goog-api-client and x-goog-user-project headers
2488
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2447
2489
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2448
2490
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2449
2491
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
2450
2492
  transports_version_send: [:rest]
2451
2493
 
2494
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2452
2495
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2453
2496
 
2454
2497
  options.apply_defaults timeout: @config.rpcs.delete_environment.timeout,
@@ -2462,7 +2505,7 @@ module Google
2462
2505
  @notebook_service_stub.delete_environment request, options do |result, operation|
2463
2506
  result = ::Gapic::Operation.new result, @operations_client, options: options
2464
2507
  yield result, operation if block_given?
2465
- return result
2508
+ throw :response, result
2466
2509
  end
2467
2510
  rescue ::Gapic::Rest::Error => e
2468
2511
  raise ::Google::Cloud::Error.from_error(e)
@@ -2536,12 +2579,13 @@ module Google
2536
2579
  # Customize the options with defaults
2537
2580
  call_metadata = @config.rpcs.list_schedules.metadata.to_h
2538
2581
 
2539
- # Set x-goog-api-client and x-goog-user-project headers
2582
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2540
2583
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2541
2584
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2542
2585
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
2543
2586
  transports_version_send: [:rest]
2544
2587
 
2588
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2545
2589
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2546
2590
 
2547
2591
  options.apply_defaults timeout: @config.rpcs.list_schedules.timeout,
@@ -2554,7 +2598,6 @@ module Google
2554
2598
 
2555
2599
  @notebook_service_stub.list_schedules request, options do |result, operation|
2556
2600
  yield result, operation if block_given?
2557
- return result
2558
2601
  end
2559
2602
  rescue ::Gapic::Rest::Error => e
2560
2603
  raise ::Google::Cloud::Error.from_error(e)
@@ -2615,12 +2658,13 @@ module Google
2615
2658
  # Customize the options with defaults
2616
2659
  call_metadata = @config.rpcs.get_schedule.metadata.to_h
2617
2660
 
2618
- # Set x-goog-api-client and x-goog-user-project headers
2661
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2619
2662
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2620
2663
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2621
2664
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
2622
2665
  transports_version_send: [:rest]
2623
2666
 
2667
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2624
2668
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2625
2669
 
2626
2670
  options.apply_defaults timeout: @config.rpcs.get_schedule.timeout,
@@ -2633,7 +2677,6 @@ module Google
2633
2677
 
2634
2678
  @notebook_service_stub.get_schedule request, options do |result, operation|
2635
2679
  yield result, operation if block_given?
2636
- return result
2637
2680
  end
2638
2681
  rescue ::Gapic::Rest::Error => e
2639
2682
  raise ::Google::Cloud::Error.from_error(e)
@@ -2701,12 +2744,13 @@ module Google
2701
2744
  # Customize the options with defaults
2702
2745
  call_metadata = @config.rpcs.delete_schedule.metadata.to_h
2703
2746
 
2704
- # Set x-goog-api-client and x-goog-user-project headers
2747
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2705
2748
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2706
2749
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2707
2750
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
2708
2751
  transports_version_send: [:rest]
2709
2752
 
2753
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2710
2754
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2711
2755
 
2712
2756
  options.apply_defaults timeout: @config.rpcs.delete_schedule.timeout,
@@ -2720,7 +2764,7 @@ module Google
2720
2764
  @notebook_service_stub.delete_schedule request, options do |result, operation|
2721
2765
  result = ::Gapic::Operation.new result, @operations_client, options: options
2722
2766
  yield result, operation if block_given?
2723
- return result
2767
+ throw :response, result
2724
2768
  end
2725
2769
  rescue ::Gapic::Rest::Error => e
2726
2770
  raise ::Google::Cloud::Error.from_error(e)
@@ -2792,12 +2836,13 @@ module Google
2792
2836
  # Customize the options with defaults
2793
2837
  call_metadata = @config.rpcs.create_schedule.metadata.to_h
2794
2838
 
2795
- # Set x-goog-api-client and x-goog-user-project headers
2839
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2796
2840
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2797
2841
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2798
2842
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
2799
2843
  transports_version_send: [:rest]
2800
2844
 
2845
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2801
2846
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2802
2847
 
2803
2848
  options.apply_defaults timeout: @config.rpcs.create_schedule.timeout,
@@ -2811,7 +2856,7 @@ module Google
2811
2856
  @notebook_service_stub.create_schedule request, options do |result, operation|
2812
2857
  result = ::Gapic::Operation.new result, @operations_client, options: options
2813
2858
  yield result, operation if block_given?
2814
- return result
2859
+ throw :response, result
2815
2860
  end
2816
2861
  rescue ::Gapic::Rest::Error => e
2817
2862
  raise ::Google::Cloud::Error.from_error(e)
@@ -2879,12 +2924,13 @@ module Google
2879
2924
  # Customize the options with defaults
2880
2925
  call_metadata = @config.rpcs.trigger_schedule.metadata.to_h
2881
2926
 
2882
- # Set x-goog-api-client and x-goog-user-project headers
2927
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2883
2928
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2884
2929
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2885
2930
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
2886
2931
  transports_version_send: [:rest]
2887
2932
 
2933
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2888
2934
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2889
2935
 
2890
2936
  options.apply_defaults timeout: @config.rpcs.trigger_schedule.timeout,
@@ -2898,7 +2944,7 @@ module Google
2898
2944
  @notebook_service_stub.trigger_schedule request, options do |result, operation|
2899
2945
  result = ::Gapic::Operation.new result, @operations_client, options: options
2900
2946
  yield result, operation if block_given?
2901
- return result
2947
+ throw :response, result
2902
2948
  end
2903
2949
  rescue ::Gapic::Rest::Error => e
2904
2950
  raise ::Google::Cloud::Error.from_error(e)
@@ -2974,12 +3020,13 @@ module Google
2974
3020
  # Customize the options with defaults
2975
3021
  call_metadata = @config.rpcs.list_executions.metadata.to_h
2976
3022
 
2977
- # Set x-goog-api-client and x-goog-user-project headers
3023
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2978
3024
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2979
3025
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2980
3026
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
2981
3027
  transports_version_send: [:rest]
2982
3028
 
3029
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2983
3030
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2984
3031
 
2985
3032
  options.apply_defaults timeout: @config.rpcs.list_executions.timeout,
@@ -2992,7 +3039,6 @@ module Google
2992
3039
 
2993
3040
  @notebook_service_stub.list_executions request, options do |result, operation|
2994
3041
  yield result, operation if block_given?
2995
- return result
2996
3042
  end
2997
3043
  rescue ::Gapic::Rest::Error => e
2998
3044
  raise ::Google::Cloud::Error.from_error(e)
@@ -3053,12 +3099,13 @@ module Google
3053
3099
  # Customize the options with defaults
3054
3100
  call_metadata = @config.rpcs.get_execution.metadata.to_h
3055
3101
 
3056
- # Set x-goog-api-client and x-goog-user-project headers
3102
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3057
3103
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3058
3104
  lib_name: @config.lib_name, lib_version: @config.lib_version,
3059
3105
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
3060
3106
  transports_version_send: [:rest]
3061
3107
 
3108
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3062
3109
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3063
3110
 
3064
3111
  options.apply_defaults timeout: @config.rpcs.get_execution.timeout,
@@ -3071,7 +3118,6 @@ module Google
3071
3118
 
3072
3119
  @notebook_service_stub.get_execution request, options do |result, operation|
3073
3120
  yield result, operation if block_given?
3074
- return result
3075
3121
  end
3076
3122
  rescue ::Gapic::Rest::Error => e
3077
3123
  raise ::Google::Cloud::Error.from_error(e)
@@ -3139,12 +3185,13 @@ module Google
3139
3185
  # Customize the options with defaults
3140
3186
  call_metadata = @config.rpcs.delete_execution.metadata.to_h
3141
3187
 
3142
- # Set x-goog-api-client and x-goog-user-project headers
3188
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3143
3189
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3144
3190
  lib_name: @config.lib_name, lib_version: @config.lib_version,
3145
3191
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
3146
3192
  transports_version_send: [:rest]
3147
3193
 
3194
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3148
3195
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3149
3196
 
3150
3197
  options.apply_defaults timeout: @config.rpcs.delete_execution.timeout,
@@ -3158,7 +3205,7 @@ module Google
3158
3205
  @notebook_service_stub.delete_execution request, options do |result, operation|
3159
3206
  result = ::Gapic::Operation.new result, @operations_client, options: options
3160
3207
  yield result, operation if block_given?
3161
- return result
3208
+ throw :response, result
3162
3209
  end
3163
3210
  rescue ::Gapic::Rest::Error => e
3164
3211
  raise ::Google::Cloud::Error.from_error(e)
@@ -3230,12 +3277,13 @@ module Google
3230
3277
  # Customize the options with defaults
3231
3278
  call_metadata = @config.rpcs.create_execution.metadata.to_h
3232
3279
 
3233
- # Set x-goog-api-client and x-goog-user-project headers
3280
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3234
3281
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3235
3282
  lib_name: @config.lib_name, lib_version: @config.lib_version,
3236
3283
  gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
3237
3284
  transports_version_send: [:rest]
3238
3285
 
3286
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3239
3287
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3240
3288
 
3241
3289
  options.apply_defaults timeout: @config.rpcs.create_execution.timeout,
@@ -3249,7 +3297,7 @@ module Google
3249
3297
  @notebook_service_stub.create_execution request, options do |result, operation|
3250
3298
  result = ::Gapic::Operation.new result, @operations_client, options: options
3251
3299
  yield result, operation if block_given?
3252
- return result
3300
+ throw :response, result
3253
3301
  end
3254
3302
  rescue ::Gapic::Rest::Error => e
3255
3303
  raise ::Google::Cloud::Error.from_error(e)
@@ -3329,6 +3377,11 @@ module Google
3329
3377
  # default endpoint URL. The default value of nil uses the environment
3330
3378
  # universe (usually the default "googleapis.com" universe).
3331
3379
  # @return [::String,nil]
3380
+ # @!attribute [rw] logger
3381
+ # A custom logger to use for request/response debug logging, or the value
3382
+ # `:default` (the default) to construct a default logger, or `nil` to
3383
+ # explicitly disable logging.
3384
+ # @return [::Logger,:default,nil]
3332
3385
  #
3333
3386
  class Configuration
3334
3387
  extend ::Gapic::Config
@@ -3357,6 +3410,7 @@ module Google
3357
3410
  # by the host service.
3358
3411
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
3359
3412
  config_attr :bindings_override, {}, ::Hash, nil
3413
+ config_attr :logger, :default, ::Logger, nil, :default
3360
3414
 
3361
3415
  # @private
3362
3416
  def initialize parent_config = nil