google-cloud-vision-v1p4beta1 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -226,7 +226,7 @@ module Google
226
226
  credentials = @config.credentials
227
227
  # Use self-signed JWT if the endpoint is unchanged from default,
228
228
  # but only if the default endpoint does not have a region prefix.
229
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
229
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
230
230
  !@config.endpoint.split(".").first.include?("-")
231
231
  credentials ||= Credentials.default scope: @config.scope,
232
232
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -296,6 +296,22 @@ module Google
296
296
  # @return [::Google::Cloud::Vision::V1p4beta1::ProductSet]
297
297
  #
298
298
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
299
+ #
300
+ # @example Basic example
301
+ # require "google/cloud/vision/v1p4beta1"
302
+ #
303
+ # # Create a client object. The client can be reused for multiple calls.
304
+ # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new
305
+ #
306
+ # # Create a request. To set request fields, pass in keyword arguments.
307
+ # request = Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest.new
308
+ #
309
+ # # Call the create_product_set method.
310
+ # result = client.create_product_set request
311
+ #
312
+ # # The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet.
313
+ # p result
314
+ #
299
315
  def create_product_set request, options = nil
300
316
  raise ::ArgumentError, "request must be provided" if request.nil?
301
317
 
@@ -369,6 +385,26 @@ module Google
369
385
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ProductSet>]
370
386
  #
371
387
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
388
+ #
389
+ # @example Basic example
390
+ # require "google/cloud/vision/v1p4beta1"
391
+ #
392
+ # # Create a client object. The client can be reused for multiple calls.
393
+ # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new
394
+ #
395
+ # # Create a request. To set request fields, pass in keyword arguments.
396
+ # request = Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest.new
397
+ #
398
+ # # Call the list_product_sets method.
399
+ # result = client.list_product_sets request
400
+ #
401
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
402
+ # # over elements, and API calls will be issued to fetch pages as needed.
403
+ # result.each do |item|
404
+ # # Each element is of type ::Google::Cloud::Vision::V1p4beta1::ProductSet.
405
+ # p item
406
+ # end
407
+ #
372
408
  def list_product_sets request, options = nil
373
409
  raise ::ArgumentError, "request must be provided" if request.nil?
374
410
 
@@ -439,6 +475,22 @@ module Google
439
475
  # @return [::Google::Cloud::Vision::V1p4beta1::ProductSet]
440
476
  #
441
477
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
478
+ #
479
+ # @example Basic example
480
+ # require "google/cloud/vision/v1p4beta1"
481
+ #
482
+ # # Create a client object. The client can be reused for multiple calls.
483
+ # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new
484
+ #
485
+ # # Create a request. To set request fields, pass in keyword arguments.
486
+ # request = Google::Cloud::Vision::V1p4beta1::GetProductSetRequest.new
487
+ #
488
+ # # Call the get_product_set method.
489
+ # result = client.get_product_set request
490
+ #
491
+ # # The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet.
492
+ # p result
493
+ #
442
494
  def get_product_set request, options = nil
443
495
  raise ::ArgumentError, "request must be provided" if request.nil?
444
496
 
@@ -513,6 +565,22 @@ module Google
513
565
  # @return [::Google::Cloud::Vision::V1p4beta1::ProductSet]
514
566
  #
515
567
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
568
+ #
569
+ # @example Basic example
570
+ # require "google/cloud/vision/v1p4beta1"
571
+ #
572
+ # # Create a client object. The client can be reused for multiple calls.
573
+ # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new
574
+ #
575
+ # # Create a request. To set request fields, pass in keyword arguments.
576
+ # request = Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest.new
577
+ #
578
+ # # Call the update_product_set method.
579
+ # result = client.update_product_set request
580
+ #
581
+ # # The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet.
582
+ # p result
583
+ #
516
584
  def update_product_set request, options = nil
517
585
  raise ::ArgumentError, "request must be provided" if request.nil?
518
586
 
@@ -581,6 +649,22 @@ module Google
581
649
  # @return [::Google::Protobuf::Empty]
582
650
  #
583
651
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
652
+ #
653
+ # @example Basic example
654
+ # require "google/cloud/vision/v1p4beta1"
655
+ #
656
+ # # Create a client object. The client can be reused for multiple calls.
657
+ # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new
658
+ #
659
+ # # Create a request. To set request fields, pass in keyword arguments.
660
+ # request = Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest.new
661
+ #
662
+ # # Call the delete_product_set method.
663
+ # result = client.delete_product_set request
664
+ #
665
+ # # The returned object is of type Google::Protobuf::Empty.
666
+ # p result
667
+ #
584
668
  def delete_product_set request, options = nil
585
669
  raise ::ArgumentError, "request must be provided" if request.nil?
586
670
 
@@ -660,6 +744,22 @@ module Google
660
744
  # @return [::Google::Cloud::Vision::V1p4beta1::Product]
661
745
  #
662
746
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
747
+ #
748
+ # @example Basic example
749
+ # require "google/cloud/vision/v1p4beta1"
750
+ #
751
+ # # Create a client object. The client can be reused for multiple calls.
752
+ # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new
753
+ #
754
+ # # Create a request. To set request fields, pass in keyword arguments.
755
+ # request = Google::Cloud::Vision::V1p4beta1::CreateProductRequest.new
756
+ #
757
+ # # Call the create_product method.
758
+ # result = client.create_product request
759
+ #
760
+ # # The returned object is of type Google::Cloud::Vision::V1p4beta1::Product.
761
+ # p result
762
+ #
663
763
  def create_product request, options = nil
664
764
  raise ::ArgumentError, "request must be provided" if request.nil?
665
765
 
@@ -733,6 +833,26 @@ module Google
733
833
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>]
734
834
  #
735
835
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
836
+ #
837
+ # @example Basic example
838
+ # require "google/cloud/vision/v1p4beta1"
839
+ #
840
+ # # Create a client object. The client can be reused for multiple calls.
841
+ # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new
842
+ #
843
+ # # Create a request. To set request fields, pass in keyword arguments.
844
+ # request = Google::Cloud::Vision::V1p4beta1::ListProductsRequest.new
845
+ #
846
+ # # Call the list_products method.
847
+ # result = client.list_products request
848
+ #
849
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
850
+ # # over elements, and API calls will be issued to fetch pages as needed.
851
+ # result.each do |item|
852
+ # # Each element is of type ::Google::Cloud::Vision::V1p4beta1::Product.
853
+ # p item
854
+ # end
855
+ #
736
856
  def list_products request, options = nil
737
857
  raise ::ArgumentError, "request must be provided" if request.nil?
738
858
 
@@ -803,6 +923,22 @@ module Google
803
923
  # @return [::Google::Cloud::Vision::V1p4beta1::Product]
804
924
  #
805
925
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
926
+ #
927
+ # @example Basic example
928
+ # require "google/cloud/vision/v1p4beta1"
929
+ #
930
+ # # Create a client object. The client can be reused for multiple calls.
931
+ # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new
932
+ #
933
+ # # Create a request. To set request fields, pass in keyword arguments.
934
+ # request = Google::Cloud::Vision::V1p4beta1::GetProductRequest.new
935
+ #
936
+ # # Call the get_product method.
937
+ # result = client.get_product request
938
+ #
939
+ # # The returned object is of type Google::Cloud::Vision::V1p4beta1::Product.
940
+ # p result
941
+ #
806
942
  def get_product request, options = nil
807
943
  raise ::ArgumentError, "request must be provided" if request.nil?
808
944
 
@@ -886,6 +1022,22 @@ module Google
886
1022
  # @return [::Google::Cloud::Vision::V1p4beta1::Product]
887
1023
  #
888
1024
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1025
+ #
1026
+ # @example Basic example
1027
+ # require "google/cloud/vision/v1p4beta1"
1028
+ #
1029
+ # # Create a client object. The client can be reused for multiple calls.
1030
+ # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new
1031
+ #
1032
+ # # Create a request. To set request fields, pass in keyword arguments.
1033
+ # request = Google::Cloud::Vision::V1p4beta1::UpdateProductRequest.new
1034
+ #
1035
+ # # Call the update_product method.
1036
+ # result = client.update_product request
1037
+ #
1038
+ # # The returned object is of type Google::Cloud::Vision::V1p4beta1::Product.
1039
+ # p result
1040
+ #
889
1041
  def update_product request, options = nil
890
1042
  raise ::ArgumentError, "request must be provided" if request.nil?
891
1043
 
@@ -955,6 +1107,22 @@ module Google
955
1107
  # @return [::Google::Protobuf::Empty]
956
1108
  #
957
1109
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1110
+ #
1111
+ # @example Basic example
1112
+ # require "google/cloud/vision/v1p4beta1"
1113
+ #
1114
+ # # Create a client object. The client can be reused for multiple calls.
1115
+ # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new
1116
+ #
1117
+ # # Create a request. To set request fields, pass in keyword arguments.
1118
+ # request = Google::Cloud::Vision::V1p4beta1::DeleteProductRequest.new
1119
+ #
1120
+ # # Call the delete_product method.
1121
+ # result = client.delete_product request
1122
+ #
1123
+ # # The returned object is of type Google::Protobuf::Empty.
1124
+ # p result
1125
+ #
958
1126
  def delete_product request, options = nil
959
1127
  raise ::ArgumentError, "request must be provided" if request.nil?
960
1128
 
@@ -1047,6 +1215,22 @@ module Google
1047
1215
  # @return [::Google::Cloud::Vision::V1p4beta1::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/v1p4beta1"
1221
+ #
1222
+ # # Create a client object. The client can be reused for multiple calls.
1223
+ # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new
1224
+ #
1225
+ # # Create a request. To set request fields, pass in keyword arguments.
1226
+ # request = Google::Cloud::Vision::V1p4beta1::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::V1p4beta1::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
 
@@ -1119,6 +1303,22 @@ module Google
1119
1303
  # @return [::Google::Protobuf::Empty]
1120
1304
  #
1121
1305
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1306
+ #
1307
+ # @example Basic example
1308
+ # require "google/cloud/vision/v1p4beta1"
1309
+ #
1310
+ # # Create a client object. The client can be reused for multiple calls.
1311
+ # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new
1312
+ #
1313
+ # # Create a request. To set request fields, pass in keyword arguments.
1314
+ # request = Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest.new
1315
+ #
1316
+ # # Call the delete_reference_image method.
1317
+ # result = client.delete_reference_image request
1318
+ #
1319
+ # # The returned object is of type Google::Protobuf::Empty.
1320
+ # p result
1321
+ #
1122
1322
  def delete_reference_image request, options = nil
1123
1323
  raise ::ArgumentError, "request must be provided" if request.nil?
1124
1324
 
@@ -1197,6 +1397,26 @@ module Google
1197
1397
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ReferenceImage>]
1198
1398
  #
1199
1399
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1400
+ #
1401
+ # @example Basic example
1402
+ # require "google/cloud/vision/v1p4beta1"
1403
+ #
1404
+ # # Create a client object. The client can be reused for multiple calls.
1405
+ # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new
1406
+ #
1407
+ # # Create a request. To set request fields, pass in keyword arguments.
1408
+ # request = Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest.new
1409
+ #
1410
+ # # Call the list_reference_images method.
1411
+ # result = client.list_reference_images request
1412
+ #
1413
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1414
+ # # over elements, and API calls will be issued to fetch pages as needed.
1415
+ # result.each do |item|
1416
+ # # Each element is of type ::Google::Cloud::Vision::V1p4beta1::ReferenceImage.
1417
+ # p item
1418
+ # end
1419
+ #
1200
1420
  def list_reference_images request, options = nil
1201
1421
  raise ::ArgumentError, "request must be provided" if request.nil?
1202
1422
 
@@ -1268,6 +1488,22 @@ module Google
1268
1488
  # @return [::Google::Cloud::Vision::V1p4beta1::ReferenceImage]
1269
1489
  #
1270
1490
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1491
+ #
1492
+ # @example Basic example
1493
+ # require "google/cloud/vision/v1p4beta1"
1494
+ #
1495
+ # # Create a client object. The client can be reused for multiple calls.
1496
+ # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new
1497
+ #
1498
+ # # Create a request. To set request fields, pass in keyword arguments.
1499
+ # request = Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest.new
1500
+ #
1501
+ # # Call the get_reference_image method.
1502
+ # result = client.get_reference_image request
1503
+ #
1504
+ # # The returned object is of type Google::Cloud::Vision::V1p4beta1::ReferenceImage.
1505
+ # p result
1506
+ #
1271
1507
  def get_reference_image request, options = nil
1272
1508
  raise ::ArgumentError, "request must be provided" if request.nil?
1273
1509
 
@@ -1345,6 +1581,22 @@ module Google
1345
1581
  # @return [::Google::Protobuf::Empty]
1346
1582
  #
1347
1583
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1584
+ #
1585
+ # @example Basic example
1586
+ # require "google/cloud/vision/v1p4beta1"
1587
+ #
1588
+ # # Create a client object. The client can be reused for multiple calls.
1589
+ # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new
1590
+ #
1591
+ # # Create a request. To set request fields, pass in keyword arguments.
1592
+ # request = Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest.new
1593
+ #
1594
+ # # Call the add_product_to_product_set method.
1595
+ # result = client.add_product_to_product_set request
1596
+ #
1597
+ # # The returned object is of type Google::Protobuf::Empty.
1598
+ # p result
1599
+ #
1348
1600
  def add_product_to_product_set request, options = nil
1349
1601
  raise ::ArgumentError, "request must be provided" if request.nil?
1350
1602
 
@@ -1416,6 +1668,22 @@ module Google
1416
1668
  # @return [::Google::Protobuf::Empty]
1417
1669
  #
1418
1670
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1671
+ #
1672
+ # @example Basic example
1673
+ # require "google/cloud/vision/v1p4beta1"
1674
+ #
1675
+ # # Create a client object. The client can be reused for multiple calls.
1676
+ # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new
1677
+ #
1678
+ # # Create a request. To set request fields, pass in keyword arguments.
1679
+ # request = Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest.new
1680
+ #
1681
+ # # Call the remove_product_from_product_set method.
1682
+ # result = client.remove_product_from_product_set request
1683
+ #
1684
+ # # The returned object is of type Google::Protobuf::Empty.
1685
+ # p result
1686
+ #
1419
1687
  def remove_product_from_product_set request, options = nil
1420
1688
  raise ::ArgumentError, "request must be provided" if request.nil?
1421
1689
 
@@ -1491,6 +1759,26 @@ module Google
1491
1759
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>]
1492
1760
  #
1493
1761
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1762
+ #
1763
+ # @example Basic example
1764
+ # require "google/cloud/vision/v1p4beta1"
1765
+ #
1766
+ # # Create a client object. The client can be reused for multiple calls.
1767
+ # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new
1768
+ #
1769
+ # # Create a request. To set request fields, pass in keyword arguments.
1770
+ # request = Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest.new
1771
+ #
1772
+ # # Call the list_products_in_product_set method.
1773
+ # result = client.list_products_in_product_set request
1774
+ #
1775
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1776
+ # # over elements, and API calls will be issued to fetch pages as needed.
1777
+ # result.each do |item|
1778
+ # # Each element is of type ::Google::Cloud::Vision::V1p4beta1::Product.
1779
+ # p item
1780
+ # end
1781
+ #
1494
1782
  def list_products_in_product_set request, options = nil
1495
1783
  raise ::ArgumentError, "request must be provided" if request.nil?
1496
1784
 
@@ -1568,6 +1856,29 @@ module Google
1568
1856
  # @return [::Gapic::Operation]
1569
1857
  #
1570
1858
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1859
+ #
1860
+ # @example Basic example
1861
+ # require "google/cloud/vision/v1p4beta1"
1862
+ #
1863
+ # # Create a client object. The client can be reused for multiple calls.
1864
+ # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new
1865
+ #
1866
+ # # Create a request. To set request fields, pass in keyword arguments.
1867
+ # request = Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest.new
1868
+ #
1869
+ # # Call the import_product_sets method.
1870
+ # result = client.import_product_sets request
1871
+ #
1872
+ # # The returned object is of type Gapic::Operation. You can use it to
1873
+ # # check the status of an operation, cancel it, or wait for results.
1874
+ # # Here is how to wait for a response.
1875
+ # result.wait_until_done! timeout: 60
1876
+ # if result.response?
1877
+ # p result.response
1878
+ # else
1879
+ # puts "No response received."
1880
+ # end
1881
+ #
1571
1882
  def import_product_sets request, options = nil
1572
1883
  raise ::ArgumentError, "request must be provided" if request.nil?
1573
1884
 
@@ -1664,6 +1975,29 @@ module Google
1664
1975
  # @return [::Gapic::Operation]
1665
1976
  #
1666
1977
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1978
+ #
1979
+ # @example Basic example
1980
+ # require "google/cloud/vision/v1p4beta1"
1981
+ #
1982
+ # # Create a client object. The client can be reused for multiple calls.
1983
+ # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new
1984
+ #
1985
+ # # Create a request. To set request fields, pass in keyword arguments.
1986
+ # request = Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest.new
1987
+ #
1988
+ # # Call the purge_products method.
1989
+ # result = client.purge_products request
1990
+ #
1991
+ # # The returned object is of type Gapic::Operation. You can use it to
1992
+ # # check the status of an operation, cancel it, or wait for results.
1993
+ # # Here is how to wait for a response.
1994
+ # result.wait_until_done! timeout: 60
1995
+ # if result.response?
1996
+ # p result.response
1997
+ # else
1998
+ # puts "No response received."
1999
+ # end
2000
+ #
1667
2001
  def purge_products request, options = nil
1668
2002
  raise ::ArgumentError, "request must be provided" if request.nil?
1669
2003
 
@@ -1773,7 +2107,9 @@ module Google
1773
2107
  class Configuration
1774
2108
  extend ::Gapic::Config
1775
2109
 
1776
- config_attr :endpoint, "vision.googleapis.com", ::String
2110
+ DEFAULT_ENDPOINT = "vision.googleapis.com"
2111
+
2112
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1777
2113
  config_attr :credentials, nil do |value|
1778
2114
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1779
2115
  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