google-cloud-vision-v1p4beta1 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -49,6 +49,9 @@ module Google
49
49
  # `projects/*/locations/*/products/*/referenceImages/*`
50
50
  #
51
51
  class Client
52
+ # @private
53
+ API_VERSION = ""
54
+
52
55
  # @private
53
56
  DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$"
54
57
 
@@ -261,8 +264,19 @@ module Google
261
264
  endpoint: @config.endpoint,
262
265
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
263
266
  universe_domain: @config.universe_domain,
264
- credentials: credentials
267
+ credentials: credentials,
268
+ logger: @config.logger
265
269
  )
270
+
271
+ @product_search_stub.logger(stub: true)&.info do |entry|
272
+ entry.set_system_name
273
+ entry.set_service
274
+ entry.message = "Created client for #{entry.service}"
275
+ entry.set_credentials_fields credentials
276
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
277
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
278
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
279
+ end
266
280
  end
267
281
 
268
282
  ##
@@ -272,6 +286,15 @@ module Google
272
286
  #
273
287
  attr_reader :operations_client
274
288
 
289
+ ##
290
+ # The logger used for request/response debug logging.
291
+ #
292
+ # @return [Logger]
293
+ #
294
+ def logger
295
+ @product_search_stub.logger
296
+ end
297
+
275
298
  # Service calls
276
299
 
277
300
  ##
@@ -342,12 +365,13 @@ module Google
342
365
  # Customize the options with defaults
343
366
  call_metadata = @config.rpcs.create_product_set.metadata.to_h
344
367
 
345
- # Set x-goog-api-client and x-goog-user-project headers
368
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
346
369
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
347
370
  lib_name: @config.lib_name, lib_version: @config.lib_version,
348
371
  gapic_version: ::Google::Cloud::Vision::V1p4beta1::VERSION,
349
372
  transports_version_send: [:rest]
350
373
 
374
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
351
375
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
352
376
 
353
377
  options.apply_defaults timeout: @config.rpcs.create_product_set.timeout,
@@ -360,7 +384,6 @@ module Google
360
384
 
361
385
  @product_search_stub.create_product_set request, options do |result, operation|
362
386
  yield result, operation if block_given?
363
- return result
364
387
  end
365
388
  rescue ::Gapic::Rest::Error => e
366
389
  raise ::Google::Cloud::Error.from_error(e)
@@ -435,12 +458,13 @@ module Google
435
458
  # Customize the options with defaults
436
459
  call_metadata = @config.rpcs.list_product_sets.metadata.to_h
437
460
 
438
- # Set x-goog-api-client and x-goog-user-project headers
461
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
439
462
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
440
463
  lib_name: @config.lib_name, lib_version: @config.lib_version,
441
464
  gapic_version: ::Google::Cloud::Vision::V1p4beta1::VERSION,
442
465
  transports_version_send: [:rest]
443
466
 
467
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
444
468
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
445
469
 
446
470
  options.apply_defaults timeout: @config.rpcs.list_product_sets.timeout,
@@ -454,7 +478,7 @@ module Google
454
478
  @product_search_stub.list_product_sets request, options do |result, operation|
455
479
  result = ::Gapic::Rest::PagedEnumerable.new @product_search_stub, :list_product_sets, "product_sets", request, result, options
456
480
  yield result, operation if block_given?
457
- return result
481
+ throw :response, result
458
482
  end
459
483
  rescue ::Gapic::Rest::Error => e
460
484
  raise ::Google::Cloud::Error.from_error(e)
@@ -521,12 +545,13 @@ module Google
521
545
  # Customize the options with defaults
522
546
  call_metadata = @config.rpcs.get_product_set.metadata.to_h
523
547
 
524
- # Set x-goog-api-client and x-goog-user-project headers
548
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
525
549
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
526
550
  lib_name: @config.lib_name, lib_version: @config.lib_version,
527
551
  gapic_version: ::Google::Cloud::Vision::V1p4beta1::VERSION,
528
552
  transports_version_send: [:rest]
529
553
 
554
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
530
555
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
531
556
 
532
557
  options.apply_defaults timeout: @config.rpcs.get_product_set.timeout,
@@ -539,7 +564,6 @@ module Google
539
564
 
540
565
  @product_search_stub.get_product_set request, options do |result, operation|
541
566
  yield result, operation if block_given?
542
- return result
543
567
  end
544
568
  rescue ::Gapic::Rest::Error => e
545
569
  raise ::Google::Cloud::Error.from_error(e)
@@ -611,12 +635,13 @@ module Google
611
635
  # Customize the options with defaults
612
636
  call_metadata = @config.rpcs.update_product_set.metadata.to_h
613
637
 
614
- # Set x-goog-api-client and x-goog-user-project headers
638
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
615
639
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
616
640
  lib_name: @config.lib_name, lib_version: @config.lib_version,
617
641
  gapic_version: ::Google::Cloud::Vision::V1p4beta1::VERSION,
618
642
  transports_version_send: [:rest]
619
643
 
644
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
620
645
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
621
646
 
622
647
  options.apply_defaults timeout: @config.rpcs.update_product_set.timeout,
@@ -629,7 +654,6 @@ module Google
629
654
 
630
655
  @product_search_stub.update_product_set request, options do |result, operation|
631
656
  yield result, operation if block_given?
632
- return result
633
657
  end
634
658
  rescue ::Gapic::Rest::Error => e
635
659
  raise ::Google::Cloud::Error.from_error(e)
@@ -695,12 +719,13 @@ module Google
695
719
  # Customize the options with defaults
696
720
  call_metadata = @config.rpcs.delete_product_set.metadata.to_h
697
721
 
698
- # Set x-goog-api-client and x-goog-user-project headers
722
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
699
723
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
700
724
  lib_name: @config.lib_name, lib_version: @config.lib_version,
701
725
  gapic_version: ::Google::Cloud::Vision::V1p4beta1::VERSION,
702
726
  transports_version_send: [:rest]
703
727
 
728
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
704
729
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
705
730
 
706
731
  options.apply_defaults timeout: @config.rpcs.delete_product_set.timeout,
@@ -713,7 +738,6 @@ module Google
713
738
 
714
739
  @product_search_stub.delete_product_set request, options do |result, operation|
715
740
  yield result, operation if block_given?
716
- return result
717
741
  end
718
742
  rescue ::Gapic::Rest::Error => e
719
743
  raise ::Google::Cloud::Error.from_error(e)
@@ -790,12 +814,13 @@ module Google
790
814
  # Customize the options with defaults
791
815
  call_metadata = @config.rpcs.create_product.metadata.to_h
792
816
 
793
- # Set x-goog-api-client and x-goog-user-project headers
817
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
794
818
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
795
819
  lib_name: @config.lib_name, lib_version: @config.lib_version,
796
820
  gapic_version: ::Google::Cloud::Vision::V1p4beta1::VERSION,
797
821
  transports_version_send: [:rest]
798
822
 
823
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
799
824
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
800
825
 
801
826
  options.apply_defaults timeout: @config.rpcs.create_product.timeout,
@@ -808,7 +833,6 @@ module Google
808
833
 
809
834
  @product_search_stub.create_product request, options do |result, operation|
810
835
  yield result, operation if block_given?
811
- return result
812
836
  end
813
837
  rescue ::Gapic::Rest::Error => e
814
838
  raise ::Google::Cloud::Error.from_error(e)
@@ -883,12 +907,13 @@ module Google
883
907
  # Customize the options with defaults
884
908
  call_metadata = @config.rpcs.list_products.metadata.to_h
885
909
 
886
- # Set x-goog-api-client and x-goog-user-project headers
910
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
887
911
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
888
912
  lib_name: @config.lib_name, lib_version: @config.lib_version,
889
913
  gapic_version: ::Google::Cloud::Vision::V1p4beta1::VERSION,
890
914
  transports_version_send: [:rest]
891
915
 
916
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
892
917
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
893
918
 
894
919
  options.apply_defaults timeout: @config.rpcs.list_products.timeout,
@@ -902,7 +927,7 @@ module Google
902
927
  @product_search_stub.list_products request, options do |result, operation|
903
928
  result = ::Gapic::Rest::PagedEnumerable.new @product_search_stub, :list_products, "products", request, result, options
904
929
  yield result, operation if block_given?
905
- return result
930
+ throw :response, result
906
931
  end
907
932
  rescue ::Gapic::Rest::Error => e
908
933
  raise ::Google::Cloud::Error.from_error(e)
@@ -969,12 +994,13 @@ module Google
969
994
  # Customize the options with defaults
970
995
  call_metadata = @config.rpcs.get_product.metadata.to_h
971
996
 
972
- # Set x-goog-api-client and x-goog-user-project headers
997
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
973
998
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
974
999
  lib_name: @config.lib_name, lib_version: @config.lib_version,
975
1000
  gapic_version: ::Google::Cloud::Vision::V1p4beta1::VERSION,
976
1001
  transports_version_send: [:rest]
977
1002
 
1003
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
978
1004
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
979
1005
 
980
1006
  options.apply_defaults timeout: @config.rpcs.get_product.timeout,
@@ -987,7 +1013,6 @@ module Google
987
1013
 
988
1014
  @product_search_stub.get_product request, options do |result, operation|
989
1015
  yield result, operation if block_given?
990
- return result
991
1016
  end
992
1017
  rescue ::Gapic::Rest::Error => e
993
1018
  raise ::Google::Cloud::Error.from_error(e)
@@ -1068,12 +1093,13 @@ module Google
1068
1093
  # Customize the options with defaults
1069
1094
  call_metadata = @config.rpcs.update_product.metadata.to_h
1070
1095
 
1071
- # Set x-goog-api-client and x-goog-user-project headers
1096
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1072
1097
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1073
1098
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1074
1099
  gapic_version: ::Google::Cloud::Vision::V1p4beta1::VERSION,
1075
1100
  transports_version_send: [:rest]
1076
1101
 
1102
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1077
1103
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1078
1104
 
1079
1105
  options.apply_defaults timeout: @config.rpcs.update_product.timeout,
@@ -1086,7 +1112,6 @@ module Google
1086
1112
 
1087
1113
  @product_search_stub.update_product request, options do |result, operation|
1088
1114
  yield result, operation if block_given?
1089
- return result
1090
1115
  end
1091
1116
  rescue ::Gapic::Rest::Error => e
1092
1117
  raise ::Google::Cloud::Error.from_error(e)
@@ -1153,12 +1178,13 @@ module Google
1153
1178
  # Customize the options with defaults
1154
1179
  call_metadata = @config.rpcs.delete_product.metadata.to_h
1155
1180
 
1156
- # Set x-goog-api-client and x-goog-user-project headers
1181
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1157
1182
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1158
1183
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1159
1184
  gapic_version: ::Google::Cloud::Vision::V1p4beta1::VERSION,
1160
1185
  transports_version_send: [:rest]
1161
1186
 
1187
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1162
1188
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1163
1189
 
1164
1190
  options.apply_defaults timeout: @config.rpcs.delete_product.timeout,
@@ -1171,7 +1197,6 @@ module Google
1171
1197
 
1172
1198
  @product_search_stub.delete_product request, options do |result, operation|
1173
1199
  yield result, operation if block_given?
1174
- return result
1175
1200
  end
1176
1201
  rescue ::Gapic::Rest::Error => e
1177
1202
  raise ::Google::Cloud::Error.from_error(e)
@@ -1261,12 +1286,13 @@ module Google
1261
1286
  # Customize the options with defaults
1262
1287
  call_metadata = @config.rpcs.create_reference_image.metadata.to_h
1263
1288
 
1264
- # Set x-goog-api-client and x-goog-user-project headers
1289
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1265
1290
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1266
1291
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1267
1292
  gapic_version: ::Google::Cloud::Vision::V1p4beta1::VERSION,
1268
1293
  transports_version_send: [:rest]
1269
1294
 
1295
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1270
1296
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1271
1297
 
1272
1298
  options.apply_defaults timeout: @config.rpcs.create_reference_image.timeout,
@@ -1279,7 +1305,6 @@ module Google
1279
1305
 
1280
1306
  @product_search_stub.create_reference_image request, options do |result, operation|
1281
1307
  yield result, operation if block_given?
1282
- return result
1283
1308
  end
1284
1309
  rescue ::Gapic::Rest::Error => e
1285
1310
  raise ::Google::Cloud::Error.from_error(e)
@@ -1349,12 +1374,13 @@ module Google
1349
1374
  # Customize the options with defaults
1350
1375
  call_metadata = @config.rpcs.delete_reference_image.metadata.to_h
1351
1376
 
1352
- # Set x-goog-api-client and x-goog-user-project headers
1377
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1353
1378
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1354
1379
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1355
1380
  gapic_version: ::Google::Cloud::Vision::V1p4beta1::VERSION,
1356
1381
  transports_version_send: [:rest]
1357
1382
 
1383
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1358
1384
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1359
1385
 
1360
1386
  options.apply_defaults timeout: @config.rpcs.delete_reference_image.timeout,
@@ -1367,7 +1393,6 @@ module Google
1367
1393
 
1368
1394
  @product_search_stub.delete_reference_image request, options do |result, operation|
1369
1395
  yield result, operation if block_given?
1370
- return result
1371
1396
  end
1372
1397
  rescue ::Gapic::Rest::Error => e
1373
1398
  raise ::Google::Cloud::Error.from_error(e)
@@ -1447,12 +1472,13 @@ module Google
1447
1472
  # Customize the options with defaults
1448
1473
  call_metadata = @config.rpcs.list_reference_images.metadata.to_h
1449
1474
 
1450
- # Set x-goog-api-client and x-goog-user-project headers
1475
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1451
1476
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1452
1477
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1453
1478
  gapic_version: ::Google::Cloud::Vision::V1p4beta1::VERSION,
1454
1479
  transports_version_send: [:rest]
1455
1480
 
1481
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1456
1482
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1457
1483
 
1458
1484
  options.apply_defaults timeout: @config.rpcs.list_reference_images.timeout,
@@ -1466,7 +1492,7 @@ module Google
1466
1492
  @product_search_stub.list_reference_images request, options do |result, operation|
1467
1493
  result = ::Gapic::Rest::PagedEnumerable.new @product_search_stub, :list_reference_images, "reference_images", request, result, options
1468
1494
  yield result, operation if block_given?
1469
- return result
1495
+ throw :response, result
1470
1496
  end
1471
1497
  rescue ::Gapic::Rest::Error => e
1472
1498
  raise ::Google::Cloud::Error.from_error(e)
@@ -1534,12 +1560,13 @@ module Google
1534
1560
  # Customize the options with defaults
1535
1561
  call_metadata = @config.rpcs.get_reference_image.metadata.to_h
1536
1562
 
1537
- # Set x-goog-api-client and x-goog-user-project headers
1563
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1538
1564
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1539
1565
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1540
1566
  gapic_version: ::Google::Cloud::Vision::V1p4beta1::VERSION,
1541
1567
  transports_version_send: [:rest]
1542
1568
 
1569
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1543
1570
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1544
1571
 
1545
1572
  options.apply_defaults timeout: @config.rpcs.get_reference_image.timeout,
@@ -1552,7 +1579,6 @@ module Google
1552
1579
 
1553
1580
  @product_search_stub.get_reference_image request, options do |result, operation|
1554
1581
  yield result, operation if block_given?
1555
- return result
1556
1582
  end
1557
1583
  rescue ::Gapic::Rest::Error => e
1558
1584
  raise ::Google::Cloud::Error.from_error(e)
@@ -1627,12 +1653,13 @@ module Google
1627
1653
  # Customize the options with defaults
1628
1654
  call_metadata = @config.rpcs.add_product_to_product_set.metadata.to_h
1629
1655
 
1630
- # Set x-goog-api-client and x-goog-user-project headers
1656
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1631
1657
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1632
1658
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1633
1659
  gapic_version: ::Google::Cloud::Vision::V1p4beta1::VERSION,
1634
1660
  transports_version_send: [:rest]
1635
1661
 
1662
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1636
1663
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1637
1664
 
1638
1665
  options.apply_defaults timeout: @config.rpcs.add_product_to_product_set.timeout,
@@ -1645,7 +1672,6 @@ module Google
1645
1672
 
1646
1673
  @product_search_stub.add_product_to_product_set request, options do |result, operation|
1647
1674
  yield result, operation if block_given?
1648
- return result
1649
1675
  end
1650
1676
  rescue ::Gapic::Rest::Error => e
1651
1677
  raise ::Google::Cloud::Error.from_error(e)
@@ -1714,12 +1740,13 @@ module Google
1714
1740
  # Customize the options with defaults
1715
1741
  call_metadata = @config.rpcs.remove_product_from_product_set.metadata.to_h
1716
1742
 
1717
- # Set x-goog-api-client and x-goog-user-project headers
1743
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1718
1744
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1719
1745
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1720
1746
  gapic_version: ::Google::Cloud::Vision::V1p4beta1::VERSION,
1721
1747
  transports_version_send: [:rest]
1722
1748
 
1749
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1723
1750
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1724
1751
 
1725
1752
  options.apply_defaults timeout: @config.rpcs.remove_product_from_product_set.timeout,
@@ -1732,7 +1759,6 @@ module Google
1732
1759
 
1733
1760
  @product_search_stub.remove_product_from_product_set request, options do |result, operation|
1734
1761
  yield result, operation if block_given?
1735
- return result
1736
1762
  end
1737
1763
  rescue ::Gapic::Rest::Error => e
1738
1764
  raise ::Google::Cloud::Error.from_error(e)
@@ -1809,12 +1835,13 @@ module Google
1809
1835
  # Customize the options with defaults
1810
1836
  call_metadata = @config.rpcs.list_products_in_product_set.metadata.to_h
1811
1837
 
1812
- # Set x-goog-api-client and x-goog-user-project headers
1838
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1813
1839
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1814
1840
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1815
1841
  gapic_version: ::Google::Cloud::Vision::V1p4beta1::VERSION,
1816
1842
  transports_version_send: [:rest]
1817
1843
 
1844
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1818
1845
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1819
1846
 
1820
1847
  options.apply_defaults timeout: @config.rpcs.list_products_in_product_set.timeout,
@@ -1828,7 +1855,7 @@ module Google
1828
1855
  @product_search_stub.list_products_in_product_set request, options do |result, operation|
1829
1856
  result = ::Gapic::Rest::PagedEnumerable.new @product_search_stub, :list_products_in_product_set, "products", request, result, options
1830
1857
  yield result, operation if block_given?
1831
- return result
1858
+ throw :response, result
1832
1859
  end
1833
1860
  rescue ::Gapic::Rest::Error => e
1834
1861
  raise ::Google::Cloud::Error.from_error(e)
@@ -1909,12 +1936,13 @@ module Google
1909
1936
  # Customize the options with defaults
1910
1937
  call_metadata = @config.rpcs.import_product_sets.metadata.to_h
1911
1938
 
1912
- # Set x-goog-api-client and x-goog-user-project headers
1939
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1913
1940
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1914
1941
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1915
1942
  gapic_version: ::Google::Cloud::Vision::V1p4beta1::VERSION,
1916
1943
  transports_version_send: [:rest]
1917
1944
 
1945
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1918
1946
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1919
1947
 
1920
1948
  options.apply_defaults timeout: @config.rpcs.import_product_sets.timeout,
@@ -1928,7 +1956,7 @@ module Google
1928
1956
  @product_search_stub.import_product_sets request, options do |result, operation|
1929
1957
  result = ::Gapic::Operation.new result, @operations_client, options: options
1930
1958
  yield result, operation if block_given?
1931
- return result
1959
+ throw :response, result
1932
1960
  end
1933
1961
  rescue ::Gapic::Rest::Error => e
1934
1962
  raise ::Google::Cloud::Error.from_error(e)
@@ -2028,12 +2056,13 @@ module Google
2028
2056
  # Customize the options with defaults
2029
2057
  call_metadata = @config.rpcs.purge_products.metadata.to_h
2030
2058
 
2031
- # Set x-goog-api-client and x-goog-user-project headers
2059
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2032
2060
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2033
2061
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2034
2062
  gapic_version: ::Google::Cloud::Vision::V1p4beta1::VERSION,
2035
2063
  transports_version_send: [:rest]
2036
2064
 
2065
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2037
2066
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2038
2067
 
2039
2068
  options.apply_defaults timeout: @config.rpcs.purge_products.timeout,
@@ -2047,7 +2076,7 @@ module Google
2047
2076
  @product_search_stub.purge_products request, options do |result, operation|
2048
2077
  result = ::Gapic::Operation.new result, @operations_client, options: options
2049
2078
  yield result, operation if block_given?
2050
- return result
2079
+ throw :response, result
2051
2080
  end
2052
2081
  rescue ::Gapic::Rest::Error => e
2053
2082
  raise ::Google::Cloud::Error.from_error(e)
@@ -2127,6 +2156,11 @@ module Google
2127
2156
  # default endpoint URL. The default value of nil uses the environment
2128
2157
  # universe (usually the default "googleapis.com" universe).
2129
2158
  # @return [::String,nil]
2159
+ # @!attribute [rw] logger
2160
+ # A custom logger to use for request/response debug logging, or the value
2161
+ # `:default` (the default) to construct a default logger, or `nil` to
2162
+ # explicitly disable logging.
2163
+ # @return [::Logger,:default,nil]
2130
2164
  #
2131
2165
  class Configuration
2132
2166
  extend ::Gapic::Config
@@ -2148,6 +2182,7 @@ module Google
2148
2182
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2149
2183
  config_attr :quota_project, nil, ::String, nil
2150
2184
  config_attr :universe_domain, nil, ::String, nil
2185
+ config_attr :logger, :default, ::Logger, nil, :default
2151
2186
 
2152
2187
  # @private
2153
2188
  def initialize parent_config = nil