google-cloud-vision-v1 0.11.1 → 0.13.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 +4 -4
- data/AUTHENTICATION.md +72 -101
- data/lib/google/cloud/vision/v1/image_annotator/client.rb +42 -9
- data/lib/google/cloud/vision/v1/image_annotator/operations.rb +38 -7
- data/lib/google/cloud/vision/v1/image_annotator/rest/client.rb +112 -7
- data/lib/google/cloud/vision/v1/image_annotator/rest/operations.rb +108 -8
- data/lib/google/cloud/vision/v1/image_annotator/rest/service_stub.rb +14 -2
- data/lib/google/cloud/vision/v1/product_search/client.rb +42 -9
- data/lib/google/cloud/vision/v1/product_search/operations.rb +38 -7
- data/lib/google/cloud/vision/v1/product_search/rest/client.rb +368 -7
- data/lib/google/cloud/vision/v1/product_search/rest/operations.rb +108 -8
- data/lib/google/cloud/vision/v1/product_search/rest/service_stub.rb +14 -2
- data/lib/google/cloud/vision/v1/version.rb +1 -1
- data/proto_docs/google/api/client.rb +14 -0
- data/proto_docs/google/api/field_behavior.rb +14 -0
- data/proto_docs/google/cloud/vision/v1/image_annotator.rb +1 -0
- metadata +5 -5
@@ -45,6 +45,9 @@ module Google
|
|
45
45
|
# `projects/*/locations/*/products/*/referenceImages/*`
|
46
46
|
#
|
47
47
|
class Client
|
48
|
+
# @private
|
49
|
+
DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$"
|
50
|
+
|
48
51
|
include Paths
|
49
52
|
|
50
53
|
# @private
|
@@ -200,6 +203,15 @@ module Google
|
|
200
203
|
@config
|
201
204
|
end
|
202
205
|
|
206
|
+
##
|
207
|
+
# The effective universe domain
|
208
|
+
#
|
209
|
+
# @return [String]
|
210
|
+
#
|
211
|
+
def universe_domain
|
212
|
+
@product_search_stub.universe_domain
|
213
|
+
end
|
214
|
+
|
203
215
|
##
|
204
216
|
# Create a new ProductSearch REST client object.
|
205
217
|
#
|
@@ -227,8 +239,9 @@ module Google
|
|
227
239
|
credentials = @config.credentials
|
228
240
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
229
241
|
# but only if the default endpoint does not have a region prefix.
|
230
|
-
enable_self_signed_jwt = @config.endpoint
|
231
|
-
|
242
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
243
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
244
|
+
!@config.endpoint.split(".").first.include?("-"))
|
232
245
|
credentials ||= Credentials.default scope: @config.scope,
|
233
246
|
enable_self_signed_jwt: enable_self_signed_jwt
|
234
247
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -242,9 +255,15 @@ module Google
|
|
242
255
|
config.credentials = credentials
|
243
256
|
config.quota_project = @quota_project_id
|
244
257
|
config.endpoint = @config.endpoint
|
258
|
+
config.universe_domain = @config.universe_domain
|
245
259
|
end
|
246
260
|
|
247
|
-
@product_search_stub = ::Google::Cloud::Vision::V1::ProductSearch::Rest::ServiceStub.new
|
261
|
+
@product_search_stub = ::Google::Cloud::Vision::V1::ProductSearch::Rest::ServiceStub.new(
|
262
|
+
endpoint: @config.endpoint,
|
263
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
264
|
+
universe_domain: @config.universe_domain,
|
265
|
+
credentials: credentials
|
266
|
+
)
|
248
267
|
end
|
249
268
|
|
250
269
|
##
|
@@ -297,6 +316,22 @@ module Google
|
|
297
316
|
# @return [::Google::Cloud::Vision::V1::ProductSet]
|
298
317
|
#
|
299
318
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
319
|
+
#
|
320
|
+
# @example Basic example
|
321
|
+
# require "google/cloud/vision/v1"
|
322
|
+
#
|
323
|
+
# # Create a client object. The client can be reused for multiple calls.
|
324
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
|
325
|
+
#
|
326
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
327
|
+
# request = Google::Cloud::Vision::V1::CreateProductSetRequest.new
|
328
|
+
#
|
329
|
+
# # Call the create_product_set method.
|
330
|
+
# result = client.create_product_set request
|
331
|
+
#
|
332
|
+
# # The returned object is of type Google::Cloud::Vision::V1::ProductSet.
|
333
|
+
# p result
|
334
|
+
#
|
300
335
|
def create_product_set request, options = nil
|
301
336
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
302
337
|
|
@@ -370,6 +405,26 @@ module Google
|
|
370
405
|
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1::ProductSet>]
|
371
406
|
#
|
372
407
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
408
|
+
#
|
409
|
+
# @example Basic example
|
410
|
+
# require "google/cloud/vision/v1"
|
411
|
+
#
|
412
|
+
# # Create a client object. The client can be reused for multiple calls.
|
413
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
|
414
|
+
#
|
415
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
416
|
+
# request = Google::Cloud::Vision::V1::ListProductSetsRequest.new
|
417
|
+
#
|
418
|
+
# # Call the list_product_sets method.
|
419
|
+
# result = client.list_product_sets request
|
420
|
+
#
|
421
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
422
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
423
|
+
# result.each do |item|
|
424
|
+
# # Each element is of type ::Google::Cloud::Vision::V1::ProductSet.
|
425
|
+
# p item
|
426
|
+
# end
|
427
|
+
#
|
373
428
|
def list_product_sets request, options = nil
|
374
429
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
375
430
|
|
@@ -440,6 +495,22 @@ module Google
|
|
440
495
|
# @return [::Google::Cloud::Vision::V1::ProductSet]
|
441
496
|
#
|
442
497
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
498
|
+
#
|
499
|
+
# @example Basic example
|
500
|
+
# require "google/cloud/vision/v1"
|
501
|
+
#
|
502
|
+
# # Create a client object. The client can be reused for multiple calls.
|
503
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
|
504
|
+
#
|
505
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
506
|
+
# request = Google::Cloud::Vision::V1::GetProductSetRequest.new
|
507
|
+
#
|
508
|
+
# # Call the get_product_set method.
|
509
|
+
# result = client.get_product_set request
|
510
|
+
#
|
511
|
+
# # The returned object is of type Google::Cloud::Vision::V1::ProductSet.
|
512
|
+
# p result
|
513
|
+
#
|
443
514
|
def get_product_set request, options = nil
|
444
515
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
445
516
|
|
@@ -514,6 +585,22 @@ module Google
|
|
514
585
|
# @return [::Google::Cloud::Vision::V1::ProductSet]
|
515
586
|
#
|
516
587
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
588
|
+
#
|
589
|
+
# @example Basic example
|
590
|
+
# require "google/cloud/vision/v1"
|
591
|
+
#
|
592
|
+
# # Create a client object. The client can be reused for multiple calls.
|
593
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
|
594
|
+
#
|
595
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
596
|
+
# request = Google::Cloud::Vision::V1::UpdateProductSetRequest.new
|
597
|
+
#
|
598
|
+
# # Call the update_product_set method.
|
599
|
+
# result = client.update_product_set request
|
600
|
+
#
|
601
|
+
# # The returned object is of type Google::Cloud::Vision::V1::ProductSet.
|
602
|
+
# p result
|
603
|
+
#
|
517
604
|
def update_product_set request, options = nil
|
518
605
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
519
606
|
|
@@ -582,6 +669,22 @@ module Google
|
|
582
669
|
# @return [::Google::Protobuf::Empty]
|
583
670
|
#
|
584
671
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
672
|
+
#
|
673
|
+
# @example Basic example
|
674
|
+
# require "google/cloud/vision/v1"
|
675
|
+
#
|
676
|
+
# # Create a client object. The client can be reused for multiple calls.
|
677
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
|
678
|
+
#
|
679
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
680
|
+
# request = Google::Cloud::Vision::V1::DeleteProductSetRequest.new
|
681
|
+
#
|
682
|
+
# # Call the delete_product_set method.
|
683
|
+
# result = client.delete_product_set request
|
684
|
+
#
|
685
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
686
|
+
# p result
|
687
|
+
#
|
585
688
|
def delete_product_set request, options = nil
|
586
689
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
587
690
|
|
@@ -661,6 +764,22 @@ module Google
|
|
661
764
|
# @return [::Google::Cloud::Vision::V1::Product]
|
662
765
|
#
|
663
766
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
767
|
+
#
|
768
|
+
# @example Basic example
|
769
|
+
# require "google/cloud/vision/v1"
|
770
|
+
#
|
771
|
+
# # Create a client object. The client can be reused for multiple calls.
|
772
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
|
773
|
+
#
|
774
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
775
|
+
# request = Google::Cloud::Vision::V1::CreateProductRequest.new
|
776
|
+
#
|
777
|
+
# # Call the create_product method.
|
778
|
+
# result = client.create_product request
|
779
|
+
#
|
780
|
+
# # The returned object is of type Google::Cloud::Vision::V1::Product.
|
781
|
+
# p result
|
782
|
+
#
|
664
783
|
def create_product request, options = nil
|
665
784
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
666
785
|
|
@@ -734,6 +853,26 @@ module Google
|
|
734
853
|
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1::Product>]
|
735
854
|
#
|
736
855
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
856
|
+
#
|
857
|
+
# @example Basic example
|
858
|
+
# require "google/cloud/vision/v1"
|
859
|
+
#
|
860
|
+
# # Create a client object. The client can be reused for multiple calls.
|
861
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
|
862
|
+
#
|
863
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
864
|
+
# request = Google::Cloud::Vision::V1::ListProductsRequest.new
|
865
|
+
#
|
866
|
+
# # Call the list_products method.
|
867
|
+
# result = client.list_products request
|
868
|
+
#
|
869
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
870
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
871
|
+
# result.each do |item|
|
872
|
+
# # Each element is of type ::Google::Cloud::Vision::V1::Product.
|
873
|
+
# p item
|
874
|
+
# end
|
875
|
+
#
|
737
876
|
def list_products request, options = nil
|
738
877
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
739
878
|
|
@@ -804,6 +943,22 @@ module Google
|
|
804
943
|
# @return [::Google::Cloud::Vision::V1::Product]
|
805
944
|
#
|
806
945
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
946
|
+
#
|
947
|
+
# @example Basic example
|
948
|
+
# require "google/cloud/vision/v1"
|
949
|
+
#
|
950
|
+
# # Create a client object. The client can be reused for multiple calls.
|
951
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
|
952
|
+
#
|
953
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
954
|
+
# request = Google::Cloud::Vision::V1::GetProductRequest.new
|
955
|
+
#
|
956
|
+
# # Call the get_product method.
|
957
|
+
# result = client.get_product request
|
958
|
+
#
|
959
|
+
# # The returned object is of type Google::Cloud::Vision::V1::Product.
|
960
|
+
# p result
|
961
|
+
#
|
807
962
|
def get_product request, options = nil
|
808
963
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
809
964
|
|
@@ -887,6 +1042,22 @@ module Google
|
|
887
1042
|
# @return [::Google::Cloud::Vision::V1::Product]
|
888
1043
|
#
|
889
1044
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1045
|
+
#
|
1046
|
+
# @example Basic example
|
1047
|
+
# require "google/cloud/vision/v1"
|
1048
|
+
#
|
1049
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1050
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
|
1051
|
+
#
|
1052
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1053
|
+
# request = Google::Cloud::Vision::V1::UpdateProductRequest.new
|
1054
|
+
#
|
1055
|
+
# # Call the update_product method.
|
1056
|
+
# result = client.update_product request
|
1057
|
+
#
|
1058
|
+
# # The returned object is of type Google::Cloud::Vision::V1::Product.
|
1059
|
+
# p result
|
1060
|
+
#
|
890
1061
|
def update_product request, options = nil
|
891
1062
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
892
1063
|
|
@@ -956,6 +1127,22 @@ module Google
|
|
956
1127
|
# @return [::Google::Protobuf::Empty]
|
957
1128
|
#
|
958
1129
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1130
|
+
#
|
1131
|
+
# @example Basic example
|
1132
|
+
# require "google/cloud/vision/v1"
|
1133
|
+
#
|
1134
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1135
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
|
1136
|
+
#
|
1137
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1138
|
+
# request = Google::Cloud::Vision::V1::DeleteProductRequest.new
|
1139
|
+
#
|
1140
|
+
# # Call the delete_product method.
|
1141
|
+
# result = client.delete_product request
|
1142
|
+
#
|
1143
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
1144
|
+
# p result
|
1145
|
+
#
|
959
1146
|
def delete_product request, options = nil
|
960
1147
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
961
1148
|
|
@@ -1047,6 +1234,22 @@ module Google
|
|
1047
1234
|
# @return [::Google::Cloud::Vision::V1::ReferenceImage]
|
1048
1235
|
#
|
1049
1236
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1237
|
+
#
|
1238
|
+
# @example Basic example
|
1239
|
+
# require "google/cloud/vision/v1"
|
1240
|
+
#
|
1241
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1242
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
|
1243
|
+
#
|
1244
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1245
|
+
# request = Google::Cloud::Vision::V1::CreateReferenceImageRequest.new
|
1246
|
+
#
|
1247
|
+
# # Call the create_reference_image method.
|
1248
|
+
# result = client.create_reference_image request
|
1249
|
+
#
|
1250
|
+
# # The returned object is of type Google::Cloud::Vision::V1::ReferenceImage.
|
1251
|
+
# p result
|
1252
|
+
#
|
1050
1253
|
def create_reference_image request, options = nil
|
1051
1254
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1052
1255
|
|
@@ -1118,6 +1321,22 @@ module Google
|
|
1118
1321
|
# @return [::Google::Protobuf::Empty]
|
1119
1322
|
#
|
1120
1323
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1324
|
+
#
|
1325
|
+
# @example Basic example
|
1326
|
+
# require "google/cloud/vision/v1"
|
1327
|
+
#
|
1328
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1329
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
|
1330
|
+
#
|
1331
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1332
|
+
# request = Google::Cloud::Vision::V1::DeleteReferenceImageRequest.new
|
1333
|
+
#
|
1334
|
+
# # Call the delete_reference_image method.
|
1335
|
+
# result = client.delete_reference_image request
|
1336
|
+
#
|
1337
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
1338
|
+
# p result
|
1339
|
+
#
|
1121
1340
|
def delete_reference_image request, options = nil
|
1122
1341
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1123
1342
|
|
@@ -1196,6 +1415,26 @@ module Google
|
|
1196
1415
|
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1::ReferenceImage>]
|
1197
1416
|
#
|
1198
1417
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1418
|
+
#
|
1419
|
+
# @example Basic example
|
1420
|
+
# require "google/cloud/vision/v1"
|
1421
|
+
#
|
1422
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1423
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
|
1424
|
+
#
|
1425
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1426
|
+
# request = Google::Cloud::Vision::V1::ListReferenceImagesRequest.new
|
1427
|
+
#
|
1428
|
+
# # Call the list_reference_images method.
|
1429
|
+
# result = client.list_reference_images request
|
1430
|
+
#
|
1431
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
1432
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
1433
|
+
# result.each do |item|
|
1434
|
+
# # Each element is of type ::Google::Cloud::Vision::V1::ReferenceImage.
|
1435
|
+
# p item
|
1436
|
+
# end
|
1437
|
+
#
|
1199
1438
|
def list_reference_images request, options = nil
|
1200
1439
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1201
1440
|
|
@@ -1266,6 +1505,22 @@ module Google
|
|
1266
1505
|
# @return [::Google::Cloud::Vision::V1::ReferenceImage]
|
1267
1506
|
#
|
1268
1507
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1508
|
+
#
|
1509
|
+
# @example Basic example
|
1510
|
+
# require "google/cloud/vision/v1"
|
1511
|
+
#
|
1512
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1513
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
|
1514
|
+
#
|
1515
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1516
|
+
# request = Google::Cloud::Vision::V1::GetReferenceImageRequest.new
|
1517
|
+
#
|
1518
|
+
# # Call the get_reference_image method.
|
1519
|
+
# result = client.get_reference_image request
|
1520
|
+
#
|
1521
|
+
# # The returned object is of type Google::Cloud::Vision::V1::ReferenceImage.
|
1522
|
+
# p result
|
1523
|
+
#
|
1269
1524
|
def get_reference_image request, options = nil
|
1270
1525
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1271
1526
|
|
@@ -1343,6 +1598,22 @@ module Google
|
|
1343
1598
|
# @return [::Google::Protobuf::Empty]
|
1344
1599
|
#
|
1345
1600
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1601
|
+
#
|
1602
|
+
# @example Basic example
|
1603
|
+
# require "google/cloud/vision/v1"
|
1604
|
+
#
|
1605
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1606
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
|
1607
|
+
#
|
1608
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1609
|
+
# request = Google::Cloud::Vision::V1::AddProductToProductSetRequest.new
|
1610
|
+
#
|
1611
|
+
# # Call the add_product_to_product_set method.
|
1612
|
+
# result = client.add_product_to_product_set request
|
1613
|
+
#
|
1614
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
1615
|
+
# p result
|
1616
|
+
#
|
1346
1617
|
def add_product_to_product_set request, options = nil
|
1347
1618
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1348
1619
|
|
@@ -1413,6 +1684,22 @@ module Google
|
|
1413
1684
|
# @return [::Google::Protobuf::Empty]
|
1414
1685
|
#
|
1415
1686
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1687
|
+
#
|
1688
|
+
# @example Basic example
|
1689
|
+
# require "google/cloud/vision/v1"
|
1690
|
+
#
|
1691
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1692
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
|
1693
|
+
#
|
1694
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1695
|
+
# request = Google::Cloud::Vision::V1::RemoveProductFromProductSetRequest.new
|
1696
|
+
#
|
1697
|
+
# # Call the remove_product_from_product_set method.
|
1698
|
+
# result = client.remove_product_from_product_set request
|
1699
|
+
#
|
1700
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
1701
|
+
# p result
|
1702
|
+
#
|
1416
1703
|
def remove_product_from_product_set request, options = nil
|
1417
1704
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1418
1705
|
|
@@ -1488,6 +1775,26 @@ module Google
|
|
1488
1775
|
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1::Product>]
|
1489
1776
|
#
|
1490
1777
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1778
|
+
#
|
1779
|
+
# @example Basic example
|
1780
|
+
# require "google/cloud/vision/v1"
|
1781
|
+
#
|
1782
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1783
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
|
1784
|
+
#
|
1785
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1786
|
+
# request = Google::Cloud::Vision::V1::ListProductsInProductSetRequest.new
|
1787
|
+
#
|
1788
|
+
# # Call the list_products_in_product_set method.
|
1789
|
+
# result = client.list_products_in_product_set request
|
1790
|
+
#
|
1791
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
1792
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
1793
|
+
# result.each do |item|
|
1794
|
+
# # Each element is of type ::Google::Cloud::Vision::V1::Product.
|
1795
|
+
# p item
|
1796
|
+
# end
|
1797
|
+
#
|
1491
1798
|
def list_products_in_product_set request, options = nil
|
1492
1799
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1493
1800
|
|
@@ -1565,6 +1872,29 @@ module Google
|
|
1565
1872
|
# @return [::Gapic::Operation]
|
1566
1873
|
#
|
1567
1874
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1875
|
+
#
|
1876
|
+
# @example Basic example
|
1877
|
+
# require "google/cloud/vision/v1"
|
1878
|
+
#
|
1879
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1880
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
|
1881
|
+
#
|
1882
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1883
|
+
# request = Google::Cloud::Vision::V1::ImportProductSetsRequest.new
|
1884
|
+
#
|
1885
|
+
# # Call the import_product_sets method.
|
1886
|
+
# result = client.import_product_sets request
|
1887
|
+
#
|
1888
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1889
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1890
|
+
# # Here is how to wait for a response.
|
1891
|
+
# result.wait_until_done! timeout: 60
|
1892
|
+
# if result.response?
|
1893
|
+
# p result.response
|
1894
|
+
# else
|
1895
|
+
# puts "No response received."
|
1896
|
+
# end
|
1897
|
+
#
|
1568
1898
|
def import_product_sets request, options = nil
|
1569
1899
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1570
1900
|
|
@@ -1661,6 +1991,29 @@ module Google
|
|
1661
1991
|
# @return [::Gapic::Operation]
|
1662
1992
|
#
|
1663
1993
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1994
|
+
#
|
1995
|
+
# @example Basic example
|
1996
|
+
# require "google/cloud/vision/v1"
|
1997
|
+
#
|
1998
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1999
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
|
2000
|
+
#
|
2001
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2002
|
+
# request = Google::Cloud::Vision::V1::PurgeProductsRequest.new
|
2003
|
+
#
|
2004
|
+
# # Call the purge_products method.
|
2005
|
+
# result = client.purge_products request
|
2006
|
+
#
|
2007
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
2008
|
+
# # check the status of an operation, cancel it, or wait for results.
|
2009
|
+
# # Here is how to wait for a response.
|
2010
|
+
# result.wait_until_done! timeout: 60
|
2011
|
+
# if result.response?
|
2012
|
+
# p result.response
|
2013
|
+
# else
|
2014
|
+
# puts "No response received."
|
2015
|
+
# end
|
2016
|
+
#
|
1664
2017
|
def purge_products request, options = nil
|
1665
2018
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1666
2019
|
|
@@ -1727,9 +2080,9 @@ module Google
|
|
1727
2080
|
# end
|
1728
2081
|
#
|
1729
2082
|
# @!attribute [rw] endpoint
|
1730
|
-
#
|
1731
|
-
#
|
1732
|
-
# @return [::String]
|
2083
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
2084
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
2085
|
+
# @return [::String,nil]
|
1733
2086
|
# @!attribute [rw] credentials
|
1734
2087
|
# Credentials to send with calls. You may provide any of the following types:
|
1735
2088
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -1766,13 +2119,20 @@ module Google
|
|
1766
2119
|
# @!attribute [rw] quota_project
|
1767
2120
|
# A separate project against which to charge quota.
|
1768
2121
|
# @return [::String]
|
2122
|
+
# @!attribute [rw] universe_domain
|
2123
|
+
# The universe domain within which to make requests. This determines the
|
2124
|
+
# default endpoint URL. The default value of nil uses the environment
|
2125
|
+
# universe (usually the default "googleapis.com" universe).
|
2126
|
+
# @return [::String,nil]
|
1769
2127
|
#
|
1770
2128
|
class Configuration
|
1771
2129
|
extend ::Gapic::Config
|
1772
2130
|
|
2131
|
+
# @private
|
2132
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
1773
2133
|
DEFAULT_ENDPOINT = "vision.googleapis.com"
|
1774
2134
|
|
1775
|
-
config_attr :endpoint,
|
2135
|
+
config_attr :endpoint, nil, ::String, nil
|
1776
2136
|
config_attr :credentials, nil do |value|
|
1777
2137
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1778
2138
|
allowed.any? { |klass| klass === value }
|
@@ -1784,6 +2144,7 @@ module Google
|
|
1784
2144
|
config_attr :metadata, nil, ::Hash, nil
|
1785
2145
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1786
2146
|
config_attr :quota_project, nil, ::String, nil
|
2147
|
+
config_attr :universe_domain, nil, ::String, nil
|
1787
2148
|
|
1788
2149
|
# @private
|
1789
2150
|
def initialize parent_config = nil
|