google-cloud-vision-v1 0.6.2 → 0.6.3
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/lib/google/cloud/vision/v1/image_annotator/client.rb +115 -40
- data/lib/google/cloud/vision/v1/image_annotator/operations.rb +125 -21
- data/lib/google/cloud/vision/v1/product_search/client.rb +409 -55
- data/lib/google/cloud/vision/v1/product_search/operations.rb +125 -21
- data/lib/google/cloud/vision/v1/version.rb +1 -1
- metadata +4 -4
@@ -54,13 +54,12 @@ module Google
|
|
54
54
|
# See {::Google::Cloud::Vision::V1::ProductSearch::Client::Configuration}
|
55
55
|
# for a description of the configuration fields.
|
56
56
|
#
|
57
|
-
#
|
57
|
+
# @example
|
58
58
|
#
|
59
|
-
#
|
60
|
-
#
|
61
|
-
#
|
62
|
-
#
|
63
|
-
# end
|
59
|
+
# # Modify the configuration for all ProductSearch clients
|
60
|
+
# ::Google::Cloud::Vision::V1::ProductSearch::Client.configure do |config|
|
61
|
+
# config.timeout = 10.0
|
62
|
+
# end
|
64
63
|
#
|
65
64
|
# @yield [config] Configure the Client client.
|
66
65
|
# @yieldparam config [Client::Configuration]
|
@@ -202,19 +201,15 @@ module Google
|
|
202
201
|
##
|
203
202
|
# Create a new ProductSearch client object.
|
204
203
|
#
|
205
|
-
#
|
206
|
-
#
|
207
|
-
# To create a new ProductSearch client with the default
|
208
|
-
# configuration:
|
204
|
+
# @example
|
209
205
|
#
|
210
|
-
#
|
206
|
+
# # Create a client using the default configuration
|
207
|
+
# client = ::Google::Cloud::Vision::V1::ProductSearch::Client.new
|
211
208
|
#
|
212
|
-
#
|
213
|
-
#
|
214
|
-
#
|
215
|
-
#
|
216
|
-
# config.timeout = 10.0
|
217
|
-
# end
|
209
|
+
# # Create a client using a custom configuration
|
210
|
+
# client = ::Google::Cloud::Vision::V1::ProductSearch::Client.new do |config|
|
211
|
+
# config.timeout = 10.0
|
212
|
+
# end
|
218
213
|
#
|
219
214
|
# @yield [config] Configure the ProductSearch client.
|
220
215
|
# @yieldparam config [Client::Configuration]
|
@@ -234,10 +229,9 @@ module Google
|
|
234
229
|
|
235
230
|
# Create credentials
|
236
231
|
credentials = @config.credentials
|
237
|
-
# Use self-signed JWT if the
|
232
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
238
233
|
# but only if the default endpoint does not have a region prefix.
|
239
|
-
enable_self_signed_jwt = @config.
|
240
|
-
@config.endpoint == Client.configure.endpoint &&
|
234
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
241
235
|
!@config.endpoint.split(".").first.include?("-")
|
242
236
|
credentials ||= Credentials.default scope: @config.scope,
|
243
237
|
enable_self_signed_jwt: enable_self_signed_jwt
|
@@ -313,6 +307,21 @@ module Google
|
|
313
307
|
#
|
314
308
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
315
309
|
#
|
310
|
+
# @example Basic example
|
311
|
+
# require "google/cloud/vision/v1"
|
312
|
+
#
|
313
|
+
# # Create a client object. The client can be reused for multiple calls.
|
314
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Client.new
|
315
|
+
#
|
316
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
317
|
+
# request = Google::Cloud::Vision::V1::CreateProductSetRequest.new
|
318
|
+
#
|
319
|
+
# # Call the create_product_set method.
|
320
|
+
# result = client.create_product_set request
|
321
|
+
#
|
322
|
+
# # The returned object is of type Google::Cloud::Vision::V1::ProductSet.
|
323
|
+
# p result
|
324
|
+
#
|
316
325
|
def create_product_set request, options = nil
|
317
326
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
318
327
|
|
@@ -339,7 +348,9 @@ module Google
|
|
339
348
|
options.apply_defaults timeout: @config.rpcs.create_product_set.timeout,
|
340
349
|
metadata: metadata,
|
341
350
|
retry_policy: @config.rpcs.create_product_set.retry_policy
|
342
|
-
|
351
|
+
|
352
|
+
options.apply_defaults timeout: @config.timeout,
|
353
|
+
metadata: @config.metadata,
|
343
354
|
retry_policy: @config.retry_policy
|
344
355
|
|
345
356
|
@product_search_stub.call_rpc :create_product_set, request, options: options do |response, operation|
|
@@ -390,6 +401,27 @@ module Google
|
|
390
401
|
#
|
391
402
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
392
403
|
#
|
404
|
+
# @example Basic example
|
405
|
+
# require "google/cloud/vision/v1"
|
406
|
+
#
|
407
|
+
# # Create a client object. The client can be reused for multiple calls.
|
408
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Client.new
|
409
|
+
#
|
410
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
411
|
+
# request = Google::Cloud::Vision::V1::ListProductSetsRequest.new
|
412
|
+
#
|
413
|
+
# # Call the list_product_sets method.
|
414
|
+
# result = client.list_product_sets request
|
415
|
+
#
|
416
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
417
|
+
# # iterate over all elements by calling #each, and the enumerable
|
418
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
419
|
+
# # methods are also available for managing paging directly.
|
420
|
+
# result.each do |response|
|
421
|
+
# # Each element is of type ::Google::Cloud::Vision::V1::ProductSet.
|
422
|
+
# p response
|
423
|
+
# end
|
424
|
+
#
|
393
425
|
def list_product_sets request, options = nil
|
394
426
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
395
427
|
|
@@ -416,7 +448,9 @@ module Google
|
|
416
448
|
options.apply_defaults timeout: @config.rpcs.list_product_sets.timeout,
|
417
449
|
metadata: metadata,
|
418
450
|
retry_policy: @config.rpcs.list_product_sets.retry_policy
|
419
|
-
|
451
|
+
|
452
|
+
options.apply_defaults timeout: @config.timeout,
|
453
|
+
metadata: @config.metadata,
|
420
454
|
retry_policy: @config.retry_policy
|
421
455
|
|
422
456
|
@product_search_stub.call_rpc :list_product_sets, request, options: options do |response, operation|
|
@@ -464,6 +498,21 @@ module Google
|
|
464
498
|
#
|
465
499
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
466
500
|
#
|
501
|
+
# @example Basic example
|
502
|
+
# require "google/cloud/vision/v1"
|
503
|
+
#
|
504
|
+
# # Create a client object. The client can be reused for multiple calls.
|
505
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Client.new
|
506
|
+
#
|
507
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
508
|
+
# request = Google::Cloud::Vision::V1::GetProductSetRequest.new
|
509
|
+
#
|
510
|
+
# # Call the get_product_set method.
|
511
|
+
# result = client.get_product_set request
|
512
|
+
#
|
513
|
+
# # The returned object is of type Google::Cloud::Vision::V1::ProductSet.
|
514
|
+
# p result
|
515
|
+
#
|
467
516
|
def get_product_set request, options = nil
|
468
517
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
469
518
|
|
@@ -490,7 +539,9 @@ module Google
|
|
490
539
|
options.apply_defaults timeout: @config.rpcs.get_product_set.timeout,
|
491
540
|
metadata: metadata,
|
492
541
|
retry_policy: @config.rpcs.get_product_set.retry_policy
|
493
|
-
|
542
|
+
|
543
|
+
options.apply_defaults timeout: @config.timeout,
|
544
|
+
metadata: @config.metadata,
|
494
545
|
retry_policy: @config.retry_policy
|
495
546
|
|
496
547
|
@product_search_stub.call_rpc :get_product_set, request, options: options do |response, operation|
|
@@ -542,6 +593,21 @@ module Google
|
|
542
593
|
#
|
543
594
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
544
595
|
#
|
596
|
+
# @example Basic example
|
597
|
+
# require "google/cloud/vision/v1"
|
598
|
+
#
|
599
|
+
# # Create a client object. The client can be reused for multiple calls.
|
600
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Client.new
|
601
|
+
#
|
602
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
603
|
+
# request = Google::Cloud::Vision::V1::UpdateProductSetRequest.new
|
604
|
+
#
|
605
|
+
# # Call the update_product_set method.
|
606
|
+
# result = client.update_product_set request
|
607
|
+
#
|
608
|
+
# # The returned object is of type Google::Cloud::Vision::V1::ProductSet.
|
609
|
+
# p result
|
610
|
+
#
|
545
611
|
def update_product_set request, options = nil
|
546
612
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
547
613
|
|
@@ -568,7 +634,9 @@ module Google
|
|
568
634
|
options.apply_defaults timeout: @config.rpcs.update_product_set.timeout,
|
569
635
|
metadata: metadata,
|
570
636
|
retry_policy: @config.rpcs.update_product_set.retry_policy
|
571
|
-
|
637
|
+
|
638
|
+
options.apply_defaults timeout: @config.timeout,
|
639
|
+
metadata: @config.metadata,
|
572
640
|
retry_policy: @config.retry_policy
|
573
641
|
|
574
642
|
@product_search_stub.call_rpc :update_product_set, request, options: options do |response, operation|
|
@@ -614,6 +682,21 @@ module Google
|
|
614
682
|
#
|
615
683
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
616
684
|
#
|
685
|
+
# @example Basic example
|
686
|
+
# require "google/cloud/vision/v1"
|
687
|
+
#
|
688
|
+
# # Create a client object. The client can be reused for multiple calls.
|
689
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Client.new
|
690
|
+
#
|
691
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
692
|
+
# request = Google::Cloud::Vision::V1::DeleteProductSetRequest.new
|
693
|
+
#
|
694
|
+
# # Call the delete_product_set method.
|
695
|
+
# result = client.delete_product_set request
|
696
|
+
#
|
697
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
698
|
+
# p result
|
699
|
+
#
|
617
700
|
def delete_product_set request, options = nil
|
618
701
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
619
702
|
|
@@ -640,7 +723,9 @@ module Google
|
|
640
723
|
options.apply_defaults timeout: @config.rpcs.delete_product_set.timeout,
|
641
724
|
metadata: metadata,
|
642
725
|
retry_policy: @config.rpcs.delete_product_set.retry_policy
|
643
|
-
|
726
|
+
|
727
|
+
options.apply_defaults timeout: @config.timeout,
|
728
|
+
metadata: @config.metadata,
|
644
729
|
retry_policy: @config.retry_policy
|
645
730
|
|
646
731
|
@product_search_stub.call_rpc :delete_product_set, request, options: options do |response, operation|
|
@@ -697,6 +782,21 @@ module Google
|
|
697
782
|
#
|
698
783
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
699
784
|
#
|
785
|
+
# @example Basic example
|
786
|
+
# require "google/cloud/vision/v1"
|
787
|
+
#
|
788
|
+
# # Create a client object. The client can be reused for multiple calls.
|
789
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Client.new
|
790
|
+
#
|
791
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
792
|
+
# request = Google::Cloud::Vision::V1::CreateProductRequest.new
|
793
|
+
#
|
794
|
+
# # Call the create_product method.
|
795
|
+
# result = client.create_product request
|
796
|
+
#
|
797
|
+
# # The returned object is of type Google::Cloud::Vision::V1::Product.
|
798
|
+
# p result
|
799
|
+
#
|
700
800
|
def create_product request, options = nil
|
701
801
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
702
802
|
|
@@ -723,7 +823,9 @@ module Google
|
|
723
823
|
options.apply_defaults timeout: @config.rpcs.create_product.timeout,
|
724
824
|
metadata: metadata,
|
725
825
|
retry_policy: @config.rpcs.create_product.retry_policy
|
726
|
-
|
826
|
+
|
827
|
+
options.apply_defaults timeout: @config.timeout,
|
828
|
+
metadata: @config.metadata,
|
727
829
|
retry_policy: @config.retry_policy
|
728
830
|
|
729
831
|
@product_search_stub.call_rpc :create_product, request, options: options do |response, operation|
|
@@ -774,6 +876,27 @@ module Google
|
|
774
876
|
#
|
775
877
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
776
878
|
#
|
879
|
+
# @example Basic example
|
880
|
+
# require "google/cloud/vision/v1"
|
881
|
+
#
|
882
|
+
# # Create a client object. The client can be reused for multiple calls.
|
883
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Client.new
|
884
|
+
#
|
885
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
886
|
+
# request = Google::Cloud::Vision::V1::ListProductsRequest.new
|
887
|
+
#
|
888
|
+
# # Call the list_products method.
|
889
|
+
# result = client.list_products request
|
890
|
+
#
|
891
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
892
|
+
# # iterate over all elements by calling #each, and the enumerable
|
893
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
894
|
+
# # methods are also available for managing paging directly.
|
895
|
+
# result.each do |response|
|
896
|
+
# # Each element is of type ::Google::Cloud::Vision::V1::Product.
|
897
|
+
# p response
|
898
|
+
# end
|
899
|
+
#
|
777
900
|
def list_products request, options = nil
|
778
901
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
779
902
|
|
@@ -800,7 +923,9 @@ module Google
|
|
800
923
|
options.apply_defaults timeout: @config.rpcs.list_products.timeout,
|
801
924
|
metadata: metadata,
|
802
925
|
retry_policy: @config.rpcs.list_products.retry_policy
|
803
|
-
|
926
|
+
|
927
|
+
options.apply_defaults timeout: @config.timeout,
|
928
|
+
metadata: @config.metadata,
|
804
929
|
retry_policy: @config.retry_policy
|
805
930
|
|
806
931
|
@product_search_stub.call_rpc :list_products, request, options: options do |response, operation|
|
@@ -848,6 +973,21 @@ module Google
|
|
848
973
|
#
|
849
974
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
850
975
|
#
|
976
|
+
# @example Basic example
|
977
|
+
# require "google/cloud/vision/v1"
|
978
|
+
#
|
979
|
+
# # Create a client object. The client can be reused for multiple calls.
|
980
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Client.new
|
981
|
+
#
|
982
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
983
|
+
# request = Google::Cloud::Vision::V1::GetProductRequest.new
|
984
|
+
#
|
985
|
+
# # Call the get_product method.
|
986
|
+
# result = client.get_product request
|
987
|
+
#
|
988
|
+
# # The returned object is of type Google::Cloud::Vision::V1::Product.
|
989
|
+
# p result
|
990
|
+
#
|
851
991
|
def get_product request, options = nil
|
852
992
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
853
993
|
|
@@ -874,7 +1014,9 @@ module Google
|
|
874
1014
|
options.apply_defaults timeout: @config.rpcs.get_product.timeout,
|
875
1015
|
metadata: metadata,
|
876
1016
|
retry_policy: @config.rpcs.get_product.retry_policy
|
877
|
-
|
1017
|
+
|
1018
|
+
options.apply_defaults timeout: @config.timeout,
|
1019
|
+
metadata: @config.metadata,
|
878
1020
|
retry_policy: @config.retry_policy
|
879
1021
|
|
880
1022
|
@product_search_stub.call_rpc :get_product, request, options: options do |response, operation|
|
@@ -935,6 +1077,21 @@ module Google
|
|
935
1077
|
#
|
936
1078
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
937
1079
|
#
|
1080
|
+
# @example Basic example
|
1081
|
+
# require "google/cloud/vision/v1"
|
1082
|
+
#
|
1083
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1084
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Client.new
|
1085
|
+
#
|
1086
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1087
|
+
# request = Google::Cloud::Vision::V1::UpdateProductRequest.new
|
1088
|
+
#
|
1089
|
+
# # Call the update_product method.
|
1090
|
+
# result = client.update_product request
|
1091
|
+
#
|
1092
|
+
# # The returned object is of type Google::Cloud::Vision::V1::Product.
|
1093
|
+
# p result
|
1094
|
+
#
|
938
1095
|
def update_product request, options = nil
|
939
1096
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
940
1097
|
|
@@ -961,7 +1118,9 @@ module Google
|
|
961
1118
|
options.apply_defaults timeout: @config.rpcs.update_product.timeout,
|
962
1119
|
metadata: metadata,
|
963
1120
|
retry_policy: @config.rpcs.update_product.retry_policy
|
964
|
-
|
1121
|
+
|
1122
|
+
options.apply_defaults timeout: @config.timeout,
|
1123
|
+
metadata: @config.metadata,
|
965
1124
|
retry_policy: @config.retry_policy
|
966
1125
|
|
967
1126
|
@product_search_stub.call_rpc :update_product, request, options: options do |response, operation|
|
@@ -1008,6 +1167,21 @@ module Google
|
|
1008
1167
|
#
|
1009
1168
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1010
1169
|
#
|
1170
|
+
# @example Basic example
|
1171
|
+
# require "google/cloud/vision/v1"
|
1172
|
+
#
|
1173
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1174
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Client.new
|
1175
|
+
#
|
1176
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1177
|
+
# request = Google::Cloud::Vision::V1::DeleteProductRequest.new
|
1178
|
+
#
|
1179
|
+
# # Call the delete_product method.
|
1180
|
+
# result = client.delete_product request
|
1181
|
+
#
|
1182
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
1183
|
+
# p result
|
1184
|
+
#
|
1011
1185
|
def delete_product request, options = nil
|
1012
1186
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1013
1187
|
|
@@ -1034,7 +1208,9 @@ module Google
|
|
1034
1208
|
options.apply_defaults timeout: @config.rpcs.delete_product.timeout,
|
1035
1209
|
metadata: metadata,
|
1036
1210
|
retry_policy: @config.rpcs.delete_product.retry_policy
|
1037
|
-
|
1211
|
+
|
1212
|
+
options.apply_defaults timeout: @config.timeout,
|
1213
|
+
metadata: @config.metadata,
|
1038
1214
|
retry_policy: @config.retry_policy
|
1039
1215
|
|
1040
1216
|
@product_search_stub.call_rpc :delete_product, request, options: options do |response, operation|
|
@@ -1103,6 +1279,21 @@ module Google
|
|
1103
1279
|
#
|
1104
1280
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1105
1281
|
#
|
1282
|
+
# @example Basic example
|
1283
|
+
# require "google/cloud/vision/v1"
|
1284
|
+
#
|
1285
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1286
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Client.new
|
1287
|
+
#
|
1288
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1289
|
+
# request = Google::Cloud::Vision::V1::CreateReferenceImageRequest.new
|
1290
|
+
#
|
1291
|
+
# # Call the create_reference_image method.
|
1292
|
+
# result = client.create_reference_image request
|
1293
|
+
#
|
1294
|
+
# # The returned object is of type Google::Cloud::Vision::V1::ReferenceImage.
|
1295
|
+
# p result
|
1296
|
+
#
|
1106
1297
|
def create_reference_image request, options = nil
|
1107
1298
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1108
1299
|
|
@@ -1129,7 +1320,9 @@ module Google
|
|
1129
1320
|
options.apply_defaults timeout: @config.rpcs.create_reference_image.timeout,
|
1130
1321
|
metadata: metadata,
|
1131
1322
|
retry_policy: @config.rpcs.create_reference_image.retry_policy
|
1132
|
-
|
1323
|
+
|
1324
|
+
options.apply_defaults timeout: @config.timeout,
|
1325
|
+
metadata: @config.metadata,
|
1133
1326
|
retry_policy: @config.retry_policy
|
1134
1327
|
|
1135
1328
|
@product_search_stub.call_rpc :create_reference_image, request, options: options do |response, operation|
|
@@ -1178,6 +1371,21 @@ module Google
|
|
1178
1371
|
#
|
1179
1372
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1180
1373
|
#
|
1374
|
+
# @example Basic example
|
1375
|
+
# require "google/cloud/vision/v1"
|
1376
|
+
#
|
1377
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1378
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Client.new
|
1379
|
+
#
|
1380
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1381
|
+
# request = Google::Cloud::Vision::V1::DeleteReferenceImageRequest.new
|
1382
|
+
#
|
1383
|
+
# # Call the delete_reference_image method.
|
1384
|
+
# result = client.delete_reference_image request
|
1385
|
+
#
|
1386
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
1387
|
+
# p result
|
1388
|
+
#
|
1181
1389
|
def delete_reference_image request, options = nil
|
1182
1390
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1183
1391
|
|
@@ -1204,7 +1412,9 @@ module Google
|
|
1204
1412
|
options.apply_defaults timeout: @config.rpcs.delete_reference_image.timeout,
|
1205
1413
|
metadata: metadata,
|
1206
1414
|
retry_policy: @config.rpcs.delete_reference_image.retry_policy
|
1207
|
-
|
1415
|
+
|
1416
|
+
options.apply_defaults timeout: @config.timeout,
|
1417
|
+
metadata: @config.metadata,
|
1208
1418
|
retry_policy: @config.retry_policy
|
1209
1419
|
|
1210
1420
|
@product_search_stub.call_rpc :delete_reference_image, request, options: options do |response, operation|
|
@@ -1260,6 +1470,27 @@ module Google
|
|
1260
1470
|
#
|
1261
1471
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1262
1472
|
#
|
1473
|
+
# @example Basic example
|
1474
|
+
# require "google/cloud/vision/v1"
|
1475
|
+
#
|
1476
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1477
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Client.new
|
1478
|
+
#
|
1479
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1480
|
+
# request = Google::Cloud::Vision::V1::ListReferenceImagesRequest.new
|
1481
|
+
#
|
1482
|
+
# # Call the list_reference_images method.
|
1483
|
+
# result = client.list_reference_images request
|
1484
|
+
#
|
1485
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
1486
|
+
# # iterate over all elements by calling #each, and the enumerable
|
1487
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
1488
|
+
# # methods are also available for managing paging directly.
|
1489
|
+
# result.each do |response|
|
1490
|
+
# # Each element is of type ::Google::Cloud::Vision::V1::ReferenceImage.
|
1491
|
+
# p response
|
1492
|
+
# end
|
1493
|
+
#
|
1263
1494
|
def list_reference_images request, options = nil
|
1264
1495
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1265
1496
|
|
@@ -1286,7 +1517,9 @@ module Google
|
|
1286
1517
|
options.apply_defaults timeout: @config.rpcs.list_reference_images.timeout,
|
1287
1518
|
metadata: metadata,
|
1288
1519
|
retry_policy: @config.rpcs.list_reference_images.retry_policy
|
1289
|
-
|
1520
|
+
|
1521
|
+
options.apply_defaults timeout: @config.timeout,
|
1522
|
+
metadata: @config.metadata,
|
1290
1523
|
retry_policy: @config.retry_policy
|
1291
1524
|
|
1292
1525
|
@product_search_stub.call_rpc :list_reference_images, request, options: options do |response, operation|
|
@@ -1334,6 +1567,21 @@ module Google
|
|
1334
1567
|
#
|
1335
1568
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1336
1569
|
#
|
1570
|
+
# @example Basic example
|
1571
|
+
# require "google/cloud/vision/v1"
|
1572
|
+
#
|
1573
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1574
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Client.new
|
1575
|
+
#
|
1576
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1577
|
+
# request = Google::Cloud::Vision::V1::GetReferenceImageRequest.new
|
1578
|
+
#
|
1579
|
+
# # Call the get_reference_image method.
|
1580
|
+
# result = client.get_reference_image request
|
1581
|
+
#
|
1582
|
+
# # The returned object is of type Google::Cloud::Vision::V1::ReferenceImage.
|
1583
|
+
# p result
|
1584
|
+
#
|
1337
1585
|
def get_reference_image request, options = nil
|
1338
1586
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1339
1587
|
|
@@ -1360,7 +1608,9 @@ module Google
|
|
1360
1608
|
options.apply_defaults timeout: @config.rpcs.get_reference_image.timeout,
|
1361
1609
|
metadata: metadata,
|
1362
1610
|
retry_policy: @config.rpcs.get_reference_image.retry_policy
|
1363
|
-
|
1611
|
+
|
1612
|
+
options.apply_defaults timeout: @config.timeout,
|
1613
|
+
metadata: @config.metadata,
|
1364
1614
|
retry_policy: @config.retry_policy
|
1365
1615
|
|
1366
1616
|
@product_search_stub.call_rpc :get_reference_image, request, options: options do |response, operation|
|
@@ -1415,6 +1665,21 @@ module Google
|
|
1415
1665
|
#
|
1416
1666
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1417
1667
|
#
|
1668
|
+
# @example Basic example
|
1669
|
+
# require "google/cloud/vision/v1"
|
1670
|
+
#
|
1671
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1672
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Client.new
|
1673
|
+
#
|
1674
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1675
|
+
# request = Google::Cloud::Vision::V1::AddProductToProductSetRequest.new
|
1676
|
+
#
|
1677
|
+
# # Call the add_product_to_product_set method.
|
1678
|
+
# result = client.add_product_to_product_set request
|
1679
|
+
#
|
1680
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
1681
|
+
# p result
|
1682
|
+
#
|
1418
1683
|
def add_product_to_product_set request, options = nil
|
1419
1684
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1420
1685
|
|
@@ -1441,7 +1706,9 @@ module Google
|
|
1441
1706
|
options.apply_defaults timeout: @config.rpcs.add_product_to_product_set.timeout,
|
1442
1707
|
metadata: metadata,
|
1443
1708
|
retry_policy: @config.rpcs.add_product_to_product_set.retry_policy
|
1444
|
-
|
1709
|
+
|
1710
|
+
options.apply_defaults timeout: @config.timeout,
|
1711
|
+
metadata: @config.metadata,
|
1445
1712
|
retry_policy: @config.retry_policy
|
1446
1713
|
|
1447
1714
|
@product_search_stub.call_rpc :add_product_to_product_set, request, options: options do |response, operation|
|
@@ -1489,6 +1756,21 @@ module Google
|
|
1489
1756
|
#
|
1490
1757
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1491
1758
|
#
|
1759
|
+
# @example Basic example
|
1760
|
+
# require "google/cloud/vision/v1"
|
1761
|
+
#
|
1762
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1763
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Client.new
|
1764
|
+
#
|
1765
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1766
|
+
# request = Google::Cloud::Vision::V1::RemoveProductFromProductSetRequest.new
|
1767
|
+
#
|
1768
|
+
# # Call the remove_product_from_product_set method.
|
1769
|
+
# result = client.remove_product_from_product_set request
|
1770
|
+
#
|
1771
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
1772
|
+
# p result
|
1773
|
+
#
|
1492
1774
|
def remove_product_from_product_set request, options = nil
|
1493
1775
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1494
1776
|
|
@@ -1515,7 +1797,9 @@ module Google
|
|
1515
1797
|
options.apply_defaults timeout: @config.rpcs.remove_product_from_product_set.timeout,
|
1516
1798
|
metadata: metadata,
|
1517
1799
|
retry_policy: @config.rpcs.remove_product_from_product_set.retry_policy
|
1518
|
-
|
1800
|
+
|
1801
|
+
options.apply_defaults timeout: @config.timeout,
|
1802
|
+
metadata: @config.metadata,
|
1519
1803
|
retry_policy: @config.retry_policy
|
1520
1804
|
|
1521
1805
|
@product_search_stub.call_rpc :remove_product_from_product_set, request, options: options do |response, operation|
|
@@ -1568,6 +1852,27 @@ module Google
|
|
1568
1852
|
#
|
1569
1853
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1570
1854
|
#
|
1855
|
+
# @example Basic example
|
1856
|
+
# require "google/cloud/vision/v1"
|
1857
|
+
#
|
1858
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1859
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Client.new
|
1860
|
+
#
|
1861
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1862
|
+
# request = Google::Cloud::Vision::V1::ListProductsInProductSetRequest.new
|
1863
|
+
#
|
1864
|
+
# # Call the list_products_in_product_set method.
|
1865
|
+
# result = client.list_products_in_product_set request
|
1866
|
+
#
|
1867
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
1868
|
+
# # iterate over all elements by calling #each, and the enumerable
|
1869
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
1870
|
+
# # methods are also available for managing paging directly.
|
1871
|
+
# result.each do |response|
|
1872
|
+
# # Each element is of type ::Google::Cloud::Vision::V1::Product.
|
1873
|
+
# p response
|
1874
|
+
# end
|
1875
|
+
#
|
1571
1876
|
def list_products_in_product_set request, options = nil
|
1572
1877
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1573
1878
|
|
@@ -1594,7 +1899,9 @@ module Google
|
|
1594
1899
|
options.apply_defaults timeout: @config.rpcs.list_products_in_product_set.timeout,
|
1595
1900
|
metadata: metadata,
|
1596
1901
|
retry_policy: @config.rpcs.list_products_in_product_set.retry_policy
|
1597
|
-
|
1902
|
+
|
1903
|
+
options.apply_defaults timeout: @config.timeout,
|
1904
|
+
metadata: @config.metadata,
|
1598
1905
|
retry_policy: @config.retry_policy
|
1599
1906
|
|
1600
1907
|
@product_search_stub.call_rpc :list_products_in_product_set, request, options: options do |response, operation|
|
@@ -1649,6 +1956,28 @@ module Google
|
|
1649
1956
|
#
|
1650
1957
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1651
1958
|
#
|
1959
|
+
# @example Basic example
|
1960
|
+
# require "google/cloud/vision/v1"
|
1961
|
+
#
|
1962
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1963
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Client.new
|
1964
|
+
#
|
1965
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1966
|
+
# request = Google::Cloud::Vision::V1::ImportProductSetsRequest.new
|
1967
|
+
#
|
1968
|
+
# # Call the import_product_sets method.
|
1969
|
+
# result = client.import_product_sets request
|
1970
|
+
#
|
1971
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
1972
|
+
# # object to check the status of an operation, cancel it, or wait
|
1973
|
+
# # for results. Here is how to block until completion:
|
1974
|
+
# result.wait_until_done! timeout: 60
|
1975
|
+
# if result.response?
|
1976
|
+
# p result.response
|
1977
|
+
# else
|
1978
|
+
# puts "Error!"
|
1979
|
+
# end
|
1980
|
+
#
|
1652
1981
|
def import_product_sets request, options = nil
|
1653
1982
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1654
1983
|
|
@@ -1675,7 +2004,9 @@ module Google
|
|
1675
2004
|
options.apply_defaults timeout: @config.rpcs.import_product_sets.timeout,
|
1676
2005
|
metadata: metadata,
|
1677
2006
|
retry_policy: @config.rpcs.import_product_sets.retry_policy
|
1678
|
-
|
2007
|
+
|
2008
|
+
options.apply_defaults timeout: @config.timeout,
|
2009
|
+
metadata: @config.metadata,
|
1679
2010
|
retry_policy: @config.retry_policy
|
1680
2011
|
|
1681
2012
|
@product_search_stub.call_rpc :import_product_sets, request, options: options do |response, operation|
|
@@ -1749,6 +2080,28 @@ module Google
|
|
1749
2080
|
#
|
1750
2081
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1751
2082
|
#
|
2083
|
+
# @example Basic example
|
2084
|
+
# require "google/cloud/vision/v1"
|
2085
|
+
#
|
2086
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2087
|
+
# client = Google::Cloud::Vision::V1::ProductSearch::Client.new
|
2088
|
+
#
|
2089
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2090
|
+
# request = Google::Cloud::Vision::V1::PurgeProductsRequest.new
|
2091
|
+
#
|
2092
|
+
# # Call the purge_products method.
|
2093
|
+
# result = client.purge_products request
|
2094
|
+
#
|
2095
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
2096
|
+
# # object to check the status of an operation, cancel it, or wait
|
2097
|
+
# # for results. Here is how to block until completion:
|
2098
|
+
# result.wait_until_done! timeout: 60
|
2099
|
+
# if result.response?
|
2100
|
+
# p result.response
|
2101
|
+
# else
|
2102
|
+
# puts "Error!"
|
2103
|
+
# end
|
2104
|
+
#
|
1752
2105
|
def purge_products request, options = nil
|
1753
2106
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1754
2107
|
|
@@ -1775,7 +2128,9 @@ module Google
|
|
1775
2128
|
options.apply_defaults timeout: @config.rpcs.purge_products.timeout,
|
1776
2129
|
metadata: metadata,
|
1777
2130
|
retry_policy: @config.rpcs.purge_products.retry_policy
|
1778
|
-
|
2131
|
+
|
2132
|
+
options.apply_defaults timeout: @config.timeout,
|
2133
|
+
metadata: @config.metadata,
|
1779
2134
|
retry_policy: @config.retry_policy
|
1780
2135
|
|
1781
2136
|
@product_search_stub.call_rpc :purge_products, request, options: options do |response, operation|
|
@@ -1800,22 +2155,21 @@ module Google
|
|
1800
2155
|
# Configuration can be applied globally to all clients, or to a single client
|
1801
2156
|
# on construction.
|
1802
2157
|
#
|
1803
|
-
#
|
1804
|
-
#
|
1805
|
-
#
|
1806
|
-
# to 20 seconds,
|
1807
|
-
#
|
1808
|
-
#
|
1809
|
-
#
|
1810
|
-
#
|
1811
|
-
#
|
1812
|
-
#
|
1813
|
-
#
|
1814
|
-
#
|
1815
|
-
#
|
1816
|
-
#
|
1817
|
-
#
|
1818
|
-
# end
|
2158
|
+
# @example
|
2159
|
+
#
|
2160
|
+
# # Modify the global config, setting the timeout for
|
2161
|
+
# # create_product_set to 20 seconds,
|
2162
|
+
# # and all remaining timeouts to 10 seconds.
|
2163
|
+
# ::Google::Cloud::Vision::V1::ProductSearch::Client.configure do |config|
|
2164
|
+
# config.timeout = 10.0
|
2165
|
+
# config.rpcs.create_product_set.timeout = 20.0
|
2166
|
+
# end
|
2167
|
+
#
|
2168
|
+
# # Apply the above configuration only to a new client.
|
2169
|
+
# client = ::Google::Cloud::Vision::V1::ProductSearch::Client.new do |config|
|
2170
|
+
# config.timeout = 10.0
|
2171
|
+
# config.rpcs.create_product_set.timeout = 20.0
|
2172
|
+
# end
|
1819
2173
|
#
|
1820
2174
|
# @!attribute [rw] endpoint
|
1821
2175
|
# The hostname or hostname:port of the service endpoint.
|