google-cloud-vision-v1 0.11.0 → 0.12.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.
@@ -227,7 +227,7 @@ module Google
227
227
  credentials = @config.credentials
228
228
  # Use self-signed JWT if the endpoint is unchanged from default,
229
229
  # but only if the default endpoint does not have a region prefix.
230
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
230
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
231
231
  !@config.endpoint.split(".").first.include?("-")
232
232
  credentials ||= Credentials.default scope: @config.scope,
233
233
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -297,6 +297,22 @@ module Google
297
297
  # @return [::Google::Cloud::Vision::V1::ProductSet]
298
298
  #
299
299
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
300
+ #
301
+ # @example Basic example
302
+ # require "google/cloud/vision/v1"
303
+ #
304
+ # # Create a client object. The client can be reused for multiple calls.
305
+ # client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
306
+ #
307
+ # # Create a request. To set request fields, pass in keyword arguments.
308
+ # request = Google::Cloud::Vision::V1::CreateProductSetRequest.new
309
+ #
310
+ # # Call the create_product_set method.
311
+ # result = client.create_product_set request
312
+ #
313
+ # # The returned object is of type Google::Cloud::Vision::V1::ProductSet.
314
+ # p result
315
+ #
300
316
  def create_product_set request, options = nil
301
317
  raise ::ArgumentError, "request must be provided" if request.nil?
302
318
 
@@ -370,6 +386,26 @@ module Google
370
386
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1::ProductSet>]
371
387
  #
372
388
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
389
+ #
390
+ # @example Basic example
391
+ # require "google/cloud/vision/v1"
392
+ #
393
+ # # Create a client object. The client can be reused for multiple calls.
394
+ # client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
395
+ #
396
+ # # Create a request. To set request fields, pass in keyword arguments.
397
+ # request = Google::Cloud::Vision::V1::ListProductSetsRequest.new
398
+ #
399
+ # # Call the list_product_sets method.
400
+ # result = client.list_product_sets request
401
+ #
402
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
403
+ # # over elements, and API calls will be issued to fetch pages as needed.
404
+ # result.each do |item|
405
+ # # Each element is of type ::Google::Cloud::Vision::V1::ProductSet.
406
+ # p item
407
+ # end
408
+ #
373
409
  def list_product_sets request, options = nil
374
410
  raise ::ArgumentError, "request must be provided" if request.nil?
375
411
 
@@ -440,6 +476,22 @@ module Google
440
476
  # @return [::Google::Cloud::Vision::V1::ProductSet]
441
477
  #
442
478
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
479
+ #
480
+ # @example Basic example
481
+ # require "google/cloud/vision/v1"
482
+ #
483
+ # # Create a client object. The client can be reused for multiple calls.
484
+ # client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
485
+ #
486
+ # # Create a request. To set request fields, pass in keyword arguments.
487
+ # request = Google::Cloud::Vision::V1::GetProductSetRequest.new
488
+ #
489
+ # # Call the get_product_set method.
490
+ # result = client.get_product_set request
491
+ #
492
+ # # The returned object is of type Google::Cloud::Vision::V1::ProductSet.
493
+ # p result
494
+ #
443
495
  def get_product_set request, options = nil
444
496
  raise ::ArgumentError, "request must be provided" if request.nil?
445
497
 
@@ -514,6 +566,22 @@ module Google
514
566
  # @return [::Google::Cloud::Vision::V1::ProductSet]
515
567
  #
516
568
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
569
+ #
570
+ # @example Basic example
571
+ # require "google/cloud/vision/v1"
572
+ #
573
+ # # Create a client object. The client can be reused for multiple calls.
574
+ # client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
575
+ #
576
+ # # Create a request. To set request fields, pass in keyword arguments.
577
+ # request = Google::Cloud::Vision::V1::UpdateProductSetRequest.new
578
+ #
579
+ # # Call the update_product_set method.
580
+ # result = client.update_product_set request
581
+ #
582
+ # # The returned object is of type Google::Cloud::Vision::V1::ProductSet.
583
+ # p result
584
+ #
517
585
  def update_product_set request, options = nil
518
586
  raise ::ArgumentError, "request must be provided" if request.nil?
519
587
 
@@ -582,6 +650,22 @@ module Google
582
650
  # @return [::Google::Protobuf::Empty]
583
651
  #
584
652
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
653
+ #
654
+ # @example Basic example
655
+ # require "google/cloud/vision/v1"
656
+ #
657
+ # # Create a client object. The client can be reused for multiple calls.
658
+ # client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
659
+ #
660
+ # # Create a request. To set request fields, pass in keyword arguments.
661
+ # request = Google::Cloud::Vision::V1::DeleteProductSetRequest.new
662
+ #
663
+ # # Call the delete_product_set method.
664
+ # result = client.delete_product_set request
665
+ #
666
+ # # The returned object is of type Google::Protobuf::Empty.
667
+ # p result
668
+ #
585
669
  def delete_product_set request, options = nil
586
670
  raise ::ArgumentError, "request must be provided" if request.nil?
587
671
 
@@ -661,6 +745,22 @@ module Google
661
745
  # @return [::Google::Cloud::Vision::V1::Product]
662
746
  #
663
747
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
748
+ #
749
+ # @example Basic example
750
+ # require "google/cloud/vision/v1"
751
+ #
752
+ # # Create a client object. The client can be reused for multiple calls.
753
+ # client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
754
+ #
755
+ # # Create a request. To set request fields, pass in keyword arguments.
756
+ # request = Google::Cloud::Vision::V1::CreateProductRequest.new
757
+ #
758
+ # # Call the create_product method.
759
+ # result = client.create_product request
760
+ #
761
+ # # The returned object is of type Google::Cloud::Vision::V1::Product.
762
+ # p result
763
+ #
664
764
  def create_product request, options = nil
665
765
  raise ::ArgumentError, "request must be provided" if request.nil?
666
766
 
@@ -734,6 +834,26 @@ module Google
734
834
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1::Product>]
735
835
  #
736
836
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
837
+ #
838
+ # @example Basic example
839
+ # require "google/cloud/vision/v1"
840
+ #
841
+ # # Create a client object. The client can be reused for multiple calls.
842
+ # client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
843
+ #
844
+ # # Create a request. To set request fields, pass in keyword arguments.
845
+ # request = Google::Cloud::Vision::V1::ListProductsRequest.new
846
+ #
847
+ # # Call the list_products method.
848
+ # result = client.list_products request
849
+ #
850
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
851
+ # # over elements, and API calls will be issued to fetch pages as needed.
852
+ # result.each do |item|
853
+ # # Each element is of type ::Google::Cloud::Vision::V1::Product.
854
+ # p item
855
+ # end
856
+ #
737
857
  def list_products request, options = nil
738
858
  raise ::ArgumentError, "request must be provided" if request.nil?
739
859
 
@@ -804,6 +924,22 @@ module Google
804
924
  # @return [::Google::Cloud::Vision::V1::Product]
805
925
  #
806
926
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
927
+ #
928
+ # @example Basic example
929
+ # require "google/cloud/vision/v1"
930
+ #
931
+ # # Create a client object. The client can be reused for multiple calls.
932
+ # client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
933
+ #
934
+ # # Create a request. To set request fields, pass in keyword arguments.
935
+ # request = Google::Cloud::Vision::V1::GetProductRequest.new
936
+ #
937
+ # # Call the get_product method.
938
+ # result = client.get_product request
939
+ #
940
+ # # The returned object is of type Google::Cloud::Vision::V1::Product.
941
+ # p result
942
+ #
807
943
  def get_product request, options = nil
808
944
  raise ::ArgumentError, "request must be provided" if request.nil?
809
945
 
@@ -887,6 +1023,22 @@ module Google
887
1023
  # @return [::Google::Cloud::Vision::V1::Product]
888
1024
  #
889
1025
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1026
+ #
1027
+ # @example Basic example
1028
+ # require "google/cloud/vision/v1"
1029
+ #
1030
+ # # Create a client object. The client can be reused for multiple calls.
1031
+ # client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
1032
+ #
1033
+ # # Create a request. To set request fields, pass in keyword arguments.
1034
+ # request = Google::Cloud::Vision::V1::UpdateProductRequest.new
1035
+ #
1036
+ # # Call the update_product method.
1037
+ # result = client.update_product request
1038
+ #
1039
+ # # The returned object is of type Google::Cloud::Vision::V1::Product.
1040
+ # p result
1041
+ #
890
1042
  def update_product request, options = nil
891
1043
  raise ::ArgumentError, "request must be provided" if request.nil?
892
1044
 
@@ -956,6 +1108,22 @@ module Google
956
1108
  # @return [::Google::Protobuf::Empty]
957
1109
  #
958
1110
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1111
+ #
1112
+ # @example Basic example
1113
+ # require "google/cloud/vision/v1"
1114
+ #
1115
+ # # Create a client object. The client can be reused for multiple calls.
1116
+ # client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
1117
+ #
1118
+ # # Create a request. To set request fields, pass in keyword arguments.
1119
+ # request = Google::Cloud::Vision::V1::DeleteProductRequest.new
1120
+ #
1121
+ # # Call the delete_product method.
1122
+ # result = client.delete_product request
1123
+ #
1124
+ # # The returned object is of type Google::Protobuf::Empty.
1125
+ # p result
1126
+ #
959
1127
  def delete_product request, options = nil
960
1128
  raise ::ArgumentError, "request must be provided" if request.nil?
961
1129
 
@@ -1047,6 +1215,22 @@ module Google
1047
1215
  # @return [::Google::Cloud::Vision::V1::ReferenceImage]
1048
1216
  #
1049
1217
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1218
+ #
1219
+ # @example Basic example
1220
+ # require "google/cloud/vision/v1"
1221
+ #
1222
+ # # Create a client object. The client can be reused for multiple calls.
1223
+ # client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
1224
+ #
1225
+ # # Create a request. To set request fields, pass in keyword arguments.
1226
+ # request = Google::Cloud::Vision::V1::CreateReferenceImageRequest.new
1227
+ #
1228
+ # # Call the create_reference_image method.
1229
+ # result = client.create_reference_image request
1230
+ #
1231
+ # # The returned object is of type Google::Cloud::Vision::V1::ReferenceImage.
1232
+ # p result
1233
+ #
1050
1234
  def create_reference_image request, options = nil
1051
1235
  raise ::ArgumentError, "request must be provided" if request.nil?
1052
1236
 
@@ -1118,6 +1302,22 @@ module Google
1118
1302
  # @return [::Google::Protobuf::Empty]
1119
1303
  #
1120
1304
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1305
+ #
1306
+ # @example Basic example
1307
+ # require "google/cloud/vision/v1"
1308
+ #
1309
+ # # Create a client object. The client can be reused for multiple calls.
1310
+ # client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
1311
+ #
1312
+ # # Create a request. To set request fields, pass in keyword arguments.
1313
+ # request = Google::Cloud::Vision::V1::DeleteReferenceImageRequest.new
1314
+ #
1315
+ # # Call the delete_reference_image method.
1316
+ # result = client.delete_reference_image request
1317
+ #
1318
+ # # The returned object is of type Google::Protobuf::Empty.
1319
+ # p result
1320
+ #
1121
1321
  def delete_reference_image request, options = nil
1122
1322
  raise ::ArgumentError, "request must be provided" if request.nil?
1123
1323
 
@@ -1196,6 +1396,26 @@ module Google
1196
1396
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1::ReferenceImage>]
1197
1397
  #
1198
1398
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1399
+ #
1400
+ # @example Basic example
1401
+ # require "google/cloud/vision/v1"
1402
+ #
1403
+ # # Create a client object. The client can be reused for multiple calls.
1404
+ # client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
1405
+ #
1406
+ # # Create a request. To set request fields, pass in keyword arguments.
1407
+ # request = Google::Cloud::Vision::V1::ListReferenceImagesRequest.new
1408
+ #
1409
+ # # Call the list_reference_images method.
1410
+ # result = client.list_reference_images request
1411
+ #
1412
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1413
+ # # over elements, and API calls will be issued to fetch pages as needed.
1414
+ # result.each do |item|
1415
+ # # Each element is of type ::Google::Cloud::Vision::V1::ReferenceImage.
1416
+ # p item
1417
+ # end
1418
+ #
1199
1419
  def list_reference_images request, options = nil
1200
1420
  raise ::ArgumentError, "request must be provided" if request.nil?
1201
1421
 
@@ -1266,6 +1486,22 @@ module Google
1266
1486
  # @return [::Google::Cloud::Vision::V1::ReferenceImage]
1267
1487
  #
1268
1488
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1489
+ #
1490
+ # @example Basic example
1491
+ # require "google/cloud/vision/v1"
1492
+ #
1493
+ # # Create a client object. The client can be reused for multiple calls.
1494
+ # client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
1495
+ #
1496
+ # # Create a request. To set request fields, pass in keyword arguments.
1497
+ # request = Google::Cloud::Vision::V1::GetReferenceImageRequest.new
1498
+ #
1499
+ # # Call the get_reference_image method.
1500
+ # result = client.get_reference_image request
1501
+ #
1502
+ # # The returned object is of type Google::Cloud::Vision::V1::ReferenceImage.
1503
+ # p result
1504
+ #
1269
1505
  def get_reference_image request, options = nil
1270
1506
  raise ::ArgumentError, "request must be provided" if request.nil?
1271
1507
 
@@ -1343,6 +1579,22 @@ module Google
1343
1579
  # @return [::Google::Protobuf::Empty]
1344
1580
  #
1345
1581
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1582
+ #
1583
+ # @example Basic example
1584
+ # require "google/cloud/vision/v1"
1585
+ #
1586
+ # # Create a client object. The client can be reused for multiple calls.
1587
+ # client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
1588
+ #
1589
+ # # Create a request. To set request fields, pass in keyword arguments.
1590
+ # request = Google::Cloud::Vision::V1::AddProductToProductSetRequest.new
1591
+ #
1592
+ # # Call the add_product_to_product_set method.
1593
+ # result = client.add_product_to_product_set request
1594
+ #
1595
+ # # The returned object is of type Google::Protobuf::Empty.
1596
+ # p result
1597
+ #
1346
1598
  def add_product_to_product_set request, options = nil
1347
1599
  raise ::ArgumentError, "request must be provided" if request.nil?
1348
1600
 
@@ -1413,6 +1665,22 @@ module Google
1413
1665
  # @return [::Google::Protobuf::Empty]
1414
1666
  #
1415
1667
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1668
+ #
1669
+ # @example Basic example
1670
+ # require "google/cloud/vision/v1"
1671
+ #
1672
+ # # Create a client object. The client can be reused for multiple calls.
1673
+ # client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
1674
+ #
1675
+ # # Create a request. To set request fields, pass in keyword arguments.
1676
+ # request = Google::Cloud::Vision::V1::RemoveProductFromProductSetRequest.new
1677
+ #
1678
+ # # Call the remove_product_from_product_set method.
1679
+ # result = client.remove_product_from_product_set request
1680
+ #
1681
+ # # The returned object is of type Google::Protobuf::Empty.
1682
+ # p result
1683
+ #
1416
1684
  def remove_product_from_product_set request, options = nil
1417
1685
  raise ::ArgumentError, "request must be provided" if request.nil?
1418
1686
 
@@ -1488,6 +1756,26 @@ module Google
1488
1756
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1::Product>]
1489
1757
  #
1490
1758
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1759
+ #
1760
+ # @example Basic example
1761
+ # require "google/cloud/vision/v1"
1762
+ #
1763
+ # # Create a client object. The client can be reused for multiple calls.
1764
+ # client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
1765
+ #
1766
+ # # Create a request. To set request fields, pass in keyword arguments.
1767
+ # request = Google::Cloud::Vision::V1::ListProductsInProductSetRequest.new
1768
+ #
1769
+ # # Call the list_products_in_product_set method.
1770
+ # result = client.list_products_in_product_set request
1771
+ #
1772
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1773
+ # # over elements, and API calls will be issued to fetch pages as needed.
1774
+ # result.each do |item|
1775
+ # # Each element is of type ::Google::Cloud::Vision::V1::Product.
1776
+ # p item
1777
+ # end
1778
+ #
1491
1779
  def list_products_in_product_set request, options = nil
1492
1780
  raise ::ArgumentError, "request must be provided" if request.nil?
1493
1781
 
@@ -1565,6 +1853,29 @@ module Google
1565
1853
  # @return [::Gapic::Operation]
1566
1854
  #
1567
1855
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1856
+ #
1857
+ # @example Basic example
1858
+ # require "google/cloud/vision/v1"
1859
+ #
1860
+ # # Create a client object. The client can be reused for multiple calls.
1861
+ # client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
1862
+ #
1863
+ # # Create a request. To set request fields, pass in keyword arguments.
1864
+ # request = Google::Cloud::Vision::V1::ImportProductSetsRequest.new
1865
+ #
1866
+ # # Call the import_product_sets method.
1867
+ # result = client.import_product_sets request
1868
+ #
1869
+ # # The returned object is of type Gapic::Operation. You can use it to
1870
+ # # check the status of an operation, cancel it, or wait for results.
1871
+ # # Here is how to wait for a response.
1872
+ # result.wait_until_done! timeout: 60
1873
+ # if result.response?
1874
+ # p result.response
1875
+ # else
1876
+ # puts "No response received."
1877
+ # end
1878
+ #
1568
1879
  def import_product_sets request, options = nil
1569
1880
  raise ::ArgumentError, "request must be provided" if request.nil?
1570
1881
 
@@ -1661,6 +1972,29 @@ module Google
1661
1972
  # @return [::Gapic::Operation]
1662
1973
  #
1663
1974
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1975
+ #
1976
+ # @example Basic example
1977
+ # require "google/cloud/vision/v1"
1978
+ #
1979
+ # # Create a client object. The client can be reused for multiple calls.
1980
+ # client = Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new
1981
+ #
1982
+ # # Create a request. To set request fields, pass in keyword arguments.
1983
+ # request = Google::Cloud::Vision::V1::PurgeProductsRequest.new
1984
+ #
1985
+ # # Call the purge_products method.
1986
+ # result = client.purge_products request
1987
+ #
1988
+ # # The returned object is of type Gapic::Operation. You can use it to
1989
+ # # check the status of an operation, cancel it, or wait for results.
1990
+ # # Here is how to wait for a response.
1991
+ # result.wait_until_done! timeout: 60
1992
+ # if result.response?
1993
+ # p result.response
1994
+ # else
1995
+ # puts "No response received."
1996
+ # end
1997
+ #
1664
1998
  def purge_products request, options = nil
1665
1999
  raise ::ArgumentError, "request must be provided" if request.nil?
1666
2000
 
@@ -1770,7 +2104,9 @@ module Google
1770
2104
  class Configuration
1771
2105
  extend ::Gapic::Config
1772
2106
 
1773
- config_attr :endpoint, "vision.googleapis.com", ::String
2107
+ DEFAULT_ENDPOINT = "vision.googleapis.com"
2108
+
2109
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1774
2110
  config_attr :credentials, nil do |value|
1775
2111
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1776
2112
  allowed.any? { |klass| klass === value }
@@ -136,6 +136,26 @@ module Google
136
136
  # @return [::Gapic::Operation]
137
137
  #
138
138
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
139
+ #
140
+ # @example Basic example
141
+ # require "google/longrunning"
142
+ #
143
+ # # Create a client object. The client can be reused for multiple calls.
144
+ # client = Google::Longrunning::Operations::Rest::Client.new
145
+ #
146
+ # # Create a request. To set request fields, pass in keyword arguments.
147
+ # request = Google::Longrunning::ListOperationsRequest.new
148
+ #
149
+ # # Call the list_operations method.
150
+ # result = client.list_operations request
151
+ #
152
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
153
+ # # over elements, and API calls will be issued to fetch pages as needed.
154
+ # result.each do |item|
155
+ # # Each element is of type ::Google::Longrunning::Operation.
156
+ # p item
157
+ # end
158
+ #
139
159
  def list_operations request, options = nil
140
160
  raise ::ArgumentError, "request must be provided" if request.nil?
141
161
 
@@ -201,6 +221,29 @@ module Google
201
221
  # @return [::Gapic::Operation]
202
222
  #
203
223
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
224
+ #
225
+ # @example Basic example
226
+ # require "google/longrunning"
227
+ #
228
+ # # Create a client object. The client can be reused for multiple calls.
229
+ # client = Google::Longrunning::Operations::Rest::Client.new
230
+ #
231
+ # # Create a request. To set request fields, pass in keyword arguments.
232
+ # request = Google::Longrunning::GetOperationRequest.new
233
+ #
234
+ # # Call the get_operation method.
235
+ # result = client.get_operation request
236
+ #
237
+ # # The returned object is of type Gapic::Operation. You can use it to
238
+ # # check the status of an operation, cancel it, or wait for results.
239
+ # # Here is how to wait for a response.
240
+ # result.wait_until_done! timeout: 60
241
+ # if result.response?
242
+ # p result.response
243
+ # else
244
+ # puts "No response received."
245
+ # end
246
+ #
204
247
  def get_operation request, options = nil
205
248
  raise ::ArgumentError, "request must be provided" if request.nil?
206
249
 
@@ -267,6 +310,22 @@ module Google
267
310
  # @return [::Google::Protobuf::Empty]
268
311
  #
269
312
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
313
+ #
314
+ # @example Basic example
315
+ # require "google/longrunning"
316
+ #
317
+ # # Create a client object. The client can be reused for multiple calls.
318
+ # client = Google::Longrunning::Operations::Rest::Client.new
319
+ #
320
+ # # Create a request. To set request fields, pass in keyword arguments.
321
+ # request = Google::Longrunning::DeleteOperationRequest.new
322
+ #
323
+ # # Call the delete_operation method.
324
+ # result = client.delete_operation request
325
+ #
326
+ # # The returned object is of type Google::Protobuf::Empty.
327
+ # p result
328
+ #
270
329
  def delete_operation request, options = nil
271
330
  raise ::ArgumentError, "request must be provided" if request.nil?
272
331
 
@@ -338,6 +397,22 @@ module Google
338
397
  # @return [::Google::Protobuf::Empty]
339
398
  #
340
399
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
400
+ #
401
+ # @example Basic example
402
+ # require "google/longrunning"
403
+ #
404
+ # # Create a client object. The client can be reused for multiple calls.
405
+ # client = Google::Longrunning::Operations::Rest::Client.new
406
+ #
407
+ # # Create a request. To set request fields, pass in keyword arguments.
408
+ # request = Google::Longrunning::CancelOperationRequest.new
409
+ #
410
+ # # Call the cancel_operation method.
411
+ # result = client.cancel_operation request
412
+ #
413
+ # # The returned object is of type Google::Protobuf::Empty.
414
+ # p result
415
+ #
341
416
  def cancel_operation request, options = nil
342
417
  raise ::ArgumentError, "request must be provided" if request.nil?
343
418
 
@@ -446,7 +521,9 @@ module Google
446
521
  class Configuration
447
522
  extend ::Gapic::Config
448
523
 
449
- config_attr :endpoint, "vision.googleapis.com", ::String
524
+ DEFAULT_ENDPOINT = "vision.googleapis.com"
525
+
526
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
450
527
  config_attr :credentials, nil do |value|
451
528
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
452
529
  allowed.any? { |klass| klass === value }
@@ -567,7 +644,7 @@ module Google
567
644
 
568
645
  verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb
569
646
  query_string_params = if query_string_params.any?
570
- query_string_params.to_h { |p| p.split("=", 2) }
647
+ query_string_params.to_h { |p| p.split "=", 2 }
571
648
  else
572
649
  {}
573
650
  end
@@ -605,7 +682,7 @@ module Google
605
682
 
606
683
  verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb
607
684
  query_string_params = if query_string_params.any?
608
- query_string_params.to_h { |p| p.split("=", 2) }
685
+ query_string_params.to_h { |p| p.split "=", 2 }
609
686
  else
610
687
  {}
611
688
  end
@@ -643,7 +720,7 @@ module Google
643
720
 
644
721
  verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb
645
722
  query_string_params = if query_string_params.any?
646
- query_string_params.to_h { |p| p.split("=", 2) }
723
+ query_string_params.to_h { |p| p.split "=", 2 }
647
724
  else
648
725
  {}
649
726
  end
@@ -681,7 +758,7 @@ module Google
681
758
 
682
759
  verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb
683
760
  query_string_params = if query_string_params.any?
684
- query_string_params.to_h { |p| p.split("=", 2) }
761
+ query_string_params.to_h { |p| p.split "=", 2 }
685
762
  else
686
763
  {}
687
764
  end