google-cloud-automl-v1 0.4.8 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/README.md +11 -6
  4. data/lib/google/cloud/automl/v1/annotation_payload_pb.rb +2 -1
  5. data/lib/google/cloud/automl/v1/annotation_spec_pb.rb +2 -1
  6. data/lib/google/cloud/automl/v1/automl/client.rb +48 -54
  7. data/lib/google/cloud/automl/v1/automl/operations.rb +23 -14
  8. data/lib/google/cloud/automl/v1/automl.rb +1 -1
  9. data/lib/google/cloud/automl/v1/data_items_pb.rb +2 -1
  10. data/lib/google/cloud/automl/v1/dataset_pb.rb +2 -1
  11. data/lib/google/cloud/automl/v1/detection_pb.rb +2 -1
  12. data/lib/google/cloud/automl/v1/image_pb.rb +2 -1
  13. data/lib/google/cloud/automl/v1/io_pb.rb +2 -1
  14. data/lib/google/cloud/automl/v1/model_evaluation_pb.rb +2 -1
  15. data/lib/google/cloud/automl/v1/model_pb.rb +2 -1
  16. data/lib/google/cloud/automl/v1/operations_pb.rb +2 -1
  17. data/lib/google/cloud/automl/v1/prediction_service/client.rb +4 -4
  18. data/lib/google/cloud/automl/v1/prediction_service/operations.rb +23 -14
  19. data/lib/google/cloud/automl/v1/prediction_service.rb +1 -1
  20. data/lib/google/cloud/automl/v1/prediction_service_pb.rb +2 -1
  21. data/lib/google/cloud/automl/v1/service_pb.rb +2 -1
  22. data/lib/google/cloud/automl/v1/text_extraction_pb.rb +2 -1
  23. data/lib/google/cloud/automl/v1/text_pb.rb +2 -1
  24. data/lib/google/cloud/automl/v1/text_sentiment_pb.rb +2 -1
  25. data/lib/google/cloud/automl/v1/translation_pb.rb +2 -1
  26. data/lib/google/cloud/automl/v1/version.rb +1 -1
  27. data/lib/google/cloud/automl/v1.rb +3 -1
  28. data/proto_docs/google/api/client.rb +318 -0
  29. data/proto_docs/google/api/launch_stage.rb +71 -0
  30. data/proto_docs/google/protobuf/any.rb +3 -3
  31. data/proto_docs/google/protobuf/empty.rb +0 -2
  32. data/proto_docs/google/rpc/status.rb +4 -2
  33. metadata +14 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef9f3c42ad066b3a740e4b4426b485c3f6522296cca545efce7b56862c8994ec
4
- data.tar.gz: bfdb45c15675fae6ba85a5f2edd121fb1e37712c5d5dc65f6570954fb25cdf9d
3
+ metadata.gz: 66f0266da5e545948078efb05876bf3714c9178b2d743981e294ac8bbe93b198
4
+ data.tar.gz: 7e06fad2f790836604d9eddd5960be3e4237725bbcfe63e5c9a39085b2e0f99e
5
5
  SHA512:
6
- metadata.gz: db23d14a423119b6288a6a904c661656acff0187cdadb0908f259344f77dd0393903e751e933dedb10a7168a594206484149e6283cb1087c4dd19f6af5572eee
7
- data.tar.gz: 159ad44b6f511726ad2884ddf3aaab5f71c69be719d241f40a2da925430d1ecb89f2184222d1aa8964847c198a399b3b91d08b32ad4c2cc73a1693f0e42b0cdb
6
+ metadata.gz: 7717621d6e08e4ac659fc382ab498bdd2550a358aca76d7f6d7250e91f3e11630ade4cdaa822e0019319fdca52bd85c47f7402d2b3d6a2c159b69fb80ae5f29f
7
+ data.tar.gz: 1d3f6f499155a56403ca1b27cbc9b7b5df511ddac7a6a5c992c8758d5d263ea679c1f68bb02838701507279b1054ae757407faf0007275cf054163364150e49c
data/AUTHENTICATION.md CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
114
114
  To configure your system for this, simply:
115
115
 
116
116
  1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
117
- 2. Authenticate using OAuth 2.0 `$ gcloud auth login`
117
+ 2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
118
118
  3. Write code as if already authenticated.
119
119
 
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
data/README.md CHANGED
@@ -46,7 +46,7 @@ for general usage information.
46
46
  ## Enabling Logging
47
47
 
48
48
  To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
49
+ The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
50
  or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
51
51
  that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
52
  and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
@@ -69,16 +69,21 @@ module GRPC
69
69
  end
70
70
  ```
71
71
 
72
+
73
+ ## Google Cloud Samples
74
+
75
+ To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
76
+
72
77
  ## Supported Ruby Versions
73
78
 
74
- This library is supported on Ruby 2.5+.
79
+ This library is supported on Ruby 2.6+.
75
80
 
76
81
  Google provides official support for Ruby versions that are actively supported
77
82
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
78
- in security maintenance, and not end of life. Currently, this means Ruby 2.5
79
- and later. Older versions of Ruby _may_ still work, but are unsupported and not
80
- recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
81
- about the Ruby support schedule.
83
+ in security maintenance, and not end of life. Older versions of Ruby _may_
84
+ still work, but are unsupported and not recommended. See
85
+ https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby
86
+ support schedule.
82
87
 
83
88
  ## Which client should I use?
84
89
 
@@ -1,12 +1,13 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/automl/v1/annotation_payload.proto
3
3
 
4
+ require 'google/protobuf'
5
+
4
6
  require 'google/cloud/automl/v1/classification_pb'
5
7
  require 'google/cloud/automl/v1/detection_pb'
6
8
  require 'google/cloud/automl/v1/text_extraction_pb'
7
9
  require 'google/cloud/automl/v1/text_sentiment_pb'
8
10
  require 'google/cloud/automl/v1/translation_pb'
9
- require 'google/protobuf'
10
11
 
11
12
  Google::Protobuf::DescriptorPool.generated_pool.build do
12
13
  add_file("google/cloud/automl/v1/annotation_payload.proto", :syntax => :proto3) do
@@ -1,9 +1,10 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/automl/v1/annotation_spec.proto
3
3
 
4
- require 'google/api/resource_pb'
5
4
  require 'google/protobuf'
6
5
 
6
+ require 'google/api/resource_pb'
7
+
7
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
8
9
  add_file("google/cloud/automl/v1/annotation_spec.proto", :syntax => :proto3) do
9
10
  add_message "google.cloud.automl.v1.AnnotationSpec" do
@@ -276,14 +276,14 @@ module Google
276
276
  # # Call the create_dataset method.
277
277
  # result = client.create_dataset request
278
278
  #
279
- # # The returned object is of type Gapic::Operation. You can use this
280
- # # object to check the status of an operation, cancel it, or wait
281
- # # for results. Here is how to block until completion:
279
+ # # The returned object is of type Gapic::Operation. You can use it to
280
+ # # check the status of an operation, cancel it, or wait for results.
281
+ # # Here is how to wait for a response.
282
282
  # result.wait_until_done! timeout: 60
283
283
  # if result.response?
284
284
  # p result.response
285
285
  # else
286
- # puts "Error!"
286
+ # puts "No response received."
287
287
  # end
288
288
  #
289
289
  def create_dataset request, options = nil
@@ -470,13 +470,11 @@ module Google
470
470
  # # Call the list_datasets method.
471
471
  # result = client.list_datasets request
472
472
  #
473
- # # The returned object is of type Gapic::PagedEnumerable. You can
474
- # # iterate over all elements by calling #each, and the enumerable
475
- # # will lazily make API calls to fetch subsequent pages. Other
476
- # # methods are also available for managing paging directly.
477
- # result.each do |response|
473
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
474
+ # # over elements, and API calls will be issued to fetch pages as needed.
475
+ # result.each do |item|
478
476
  # # Each element is of type ::Google::Cloud::AutoML::V1::Dataset.
479
- # p response
477
+ # p item
480
478
  # end
481
479
  #
482
480
  def list_datasets request, options = nil
@@ -653,14 +651,14 @@ module Google
653
651
  # # Call the delete_dataset method.
654
652
  # result = client.delete_dataset request
655
653
  #
656
- # # The returned object is of type Gapic::Operation. You can use this
657
- # # object to check the status of an operation, cancel it, or wait
658
- # # for results. Here is how to block until completion:
654
+ # # The returned object is of type Gapic::Operation. You can use it to
655
+ # # check the status of an operation, cancel it, or wait for results.
656
+ # # Here is how to wait for a response.
659
657
  # result.wait_until_done! timeout: 60
660
658
  # if result.response?
661
659
  # p result.response
662
660
  # else
663
- # puts "Error!"
661
+ # puts "No response received."
664
662
  # end
665
663
  #
666
664
  def delete_dataset request, options = nil
@@ -758,14 +756,14 @@ module Google
758
756
  # # Call the import_data method.
759
757
  # result = client.import_data request
760
758
  #
761
- # # The returned object is of type Gapic::Operation. You can use this
762
- # # object to check the status of an operation, cancel it, or wait
763
- # # for results. Here is how to block until completion:
759
+ # # The returned object is of type Gapic::Operation. You can use it to
760
+ # # check the status of an operation, cancel it, or wait for results.
761
+ # # Here is how to wait for a response.
764
762
  # result.wait_until_done! timeout: 60
765
763
  # if result.response?
766
764
  # p result.response
767
765
  # else
768
- # puts "Error!"
766
+ # puts "No response received."
769
767
  # end
770
768
  #
771
769
  def import_data request, options = nil
@@ -855,14 +853,14 @@ module Google
855
853
  # # Call the export_data method.
856
854
  # result = client.export_data request
857
855
  #
858
- # # The returned object is of type Gapic::Operation. You can use this
859
- # # object to check the status of an operation, cancel it, or wait
860
- # # for results. Here is how to block until completion:
856
+ # # The returned object is of type Gapic::Operation. You can use it to
857
+ # # check the status of an operation, cancel it, or wait for results.
858
+ # # Here is how to wait for a response.
861
859
  # result.wait_until_done! timeout: 60
862
860
  # if result.response?
863
861
  # p result.response
864
862
  # else
865
- # puts "Error!"
863
+ # puts "No response received."
866
864
  # end
867
865
  #
868
866
  def export_data request, options = nil
@@ -1039,14 +1037,14 @@ module Google
1039
1037
  # # Call the create_model method.
1040
1038
  # result = client.create_model request
1041
1039
  #
1042
- # # The returned object is of type Gapic::Operation. You can use this
1043
- # # object to check the status of an operation, cancel it, or wait
1044
- # # for results. Here is how to block until completion:
1040
+ # # The returned object is of type Gapic::Operation. You can use it to
1041
+ # # check the status of an operation, cancel it, or wait for results.
1042
+ # # Here is how to wait for a response.
1045
1043
  # result.wait_until_done! timeout: 60
1046
1044
  # if result.response?
1047
1045
  # p result.response
1048
1046
  # else
1049
- # puts "Error!"
1047
+ # puts "No response received."
1050
1048
  # end
1051
1049
  #
1052
1050
  def create_model request, options = nil
@@ -1234,13 +1232,11 @@ module Google
1234
1232
  # # Call the list_models method.
1235
1233
  # result = client.list_models request
1236
1234
  #
1237
- # # The returned object is of type Gapic::PagedEnumerable. You can
1238
- # # iterate over all elements by calling #each, and the enumerable
1239
- # # will lazily make API calls to fetch subsequent pages. Other
1240
- # # methods are also available for managing paging directly.
1241
- # result.each do |response|
1235
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1236
+ # # over elements, and API calls will be issued to fetch pages as needed.
1237
+ # result.each do |item|
1242
1238
  # # Each element is of type ::Google::Cloud::AutoML::V1::Model.
1243
- # p response
1239
+ # p item
1244
1240
  # end
1245
1241
  #
1246
1242
  def list_models request, options = nil
@@ -1330,14 +1326,14 @@ module Google
1330
1326
  # # Call the delete_model method.
1331
1327
  # result = client.delete_model request
1332
1328
  #
1333
- # # The returned object is of type Gapic::Operation. You can use this
1334
- # # object to check the status of an operation, cancel it, or wait
1335
- # # for results. Here is how to block until completion:
1329
+ # # The returned object is of type Gapic::Operation. You can use it to
1330
+ # # check the status of an operation, cancel it, or wait for results.
1331
+ # # Here is how to wait for a response.
1336
1332
  # result.wait_until_done! timeout: 60
1337
1333
  # if result.response?
1338
1334
  # p result.response
1339
1335
  # else
1340
- # puts "Error!"
1336
+ # puts "No response received."
1341
1337
  # end
1342
1338
  #
1343
1339
  def delete_model request, options = nil
@@ -1524,14 +1520,14 @@ module Google
1524
1520
  # # Call the deploy_model method.
1525
1521
  # result = client.deploy_model request
1526
1522
  #
1527
- # # The returned object is of type Gapic::Operation. You can use this
1528
- # # object to check the status of an operation, cancel it, or wait
1529
- # # for results. Here is how to block until completion:
1523
+ # # The returned object is of type Gapic::Operation. You can use it to
1524
+ # # check the status of an operation, cancel it, or wait for results.
1525
+ # # Here is how to wait for a response.
1530
1526
  # result.wait_until_done! timeout: 60
1531
1527
  # if result.response?
1532
1528
  # p result.response
1533
1529
  # else
1534
- # puts "Error!"
1530
+ # puts "No response received."
1535
1531
  # end
1536
1532
  #
1537
1533
  def deploy_model request, options = nil
@@ -1623,14 +1619,14 @@ module Google
1623
1619
  # # Call the undeploy_model method.
1624
1620
  # result = client.undeploy_model request
1625
1621
  #
1626
- # # The returned object is of type Gapic::Operation. You can use this
1627
- # # object to check the status of an operation, cancel it, or wait
1628
- # # for results. Here is how to block until completion:
1622
+ # # The returned object is of type Gapic::Operation. You can use it to
1623
+ # # check the status of an operation, cancel it, or wait for results.
1624
+ # # Here is how to wait for a response.
1629
1625
  # result.wait_until_done! timeout: 60
1630
1626
  # if result.response?
1631
1627
  # p result.response
1632
1628
  # else
1633
- # puts "Error!"
1629
+ # puts "No response received."
1634
1630
  # end
1635
1631
  #
1636
1632
  def undeploy_model request, options = nil
@@ -1724,14 +1720,14 @@ module Google
1724
1720
  # # Call the export_model method.
1725
1721
  # result = client.export_model request
1726
1722
  #
1727
- # # The returned object is of type Gapic::Operation. You can use this
1728
- # # object to check the status of an operation, cancel it, or wait
1729
- # # for results. Here is how to block until completion:
1723
+ # # The returned object is of type Gapic::Operation. You can use it to
1724
+ # # check the status of an operation, cancel it, or wait for results.
1725
+ # # Here is how to wait for a response.
1730
1726
  # result.wait_until_done! timeout: 60
1731
1727
  # if result.response?
1732
1728
  # p result.response
1733
1729
  # else
1734
- # puts "Error!"
1730
+ # puts "No response received."
1735
1731
  # end
1736
1732
  #
1737
1733
  def export_model request, options = nil
@@ -1923,13 +1919,11 @@ module Google
1923
1919
  # # Call the list_model_evaluations method.
1924
1920
  # result = client.list_model_evaluations request
1925
1921
  #
1926
- # # The returned object is of type Gapic::PagedEnumerable. You can
1927
- # # iterate over all elements by calling #each, and the enumerable
1928
- # # will lazily make API calls to fetch subsequent pages. Other
1929
- # # methods are also available for managing paging directly.
1930
- # result.each do |response|
1922
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1923
+ # # over elements, and API calls will be issued to fetch pages as needed.
1924
+ # result.each do |item|
1931
1925
  # # Each element is of type ::Google::Cloud::AutoML::V1::ModelEvaluation.
1932
- # p response
1926
+ # p item
1933
1927
  # end
1934
1928
  #
1935
1929
  def list_model_evaluations request, options = nil
@@ -95,6 +95,9 @@ module Google
95
95
  channel_args: @config.channel_args,
96
96
  interceptors: @config.interceptors
97
97
  )
98
+
99
+ # Used by an LRO wrapper for some methods of this service
100
+ @operations_client = self
98
101
  end
99
102
 
100
103
  # Service calls
@@ -155,13 +158,11 @@ module Google
155
158
  # # Call the list_operations method.
156
159
  # result = client.list_operations request
157
160
  #
158
- # # The returned object is of type Gapic::PagedEnumerable. You can
159
- # # iterate over all elements by calling #each, and the enumerable
160
- # # will lazily make API calls to fetch subsequent pages. Other
161
- # # methods are also available for managing paging directly.
162
- # result.each do |response|
161
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
162
+ # # over elements, and API calls will be issued to fetch pages as needed.
163
+ # result.each do |item|
163
164
  # # Each element is of type ::Google::Longrunning::Operation.
164
- # p response
165
+ # p item
165
166
  # end
166
167
  #
167
168
  def list_operations request, options = nil
@@ -250,14 +251,14 @@ module Google
250
251
  # # Call the get_operation method.
251
252
  # result = client.get_operation request
252
253
  #
253
- # # The returned object is of type Gapic::Operation. You can use this
254
- # # object to check the status of an operation, cancel it, or wait
255
- # # for results. Here is how to block until completion:
254
+ # # The returned object is of type Gapic::Operation. You can use it to
255
+ # # check the status of an operation, cancel it, or wait for results.
256
+ # # Here is how to wait for a response.
256
257
  # result.wait_until_done! timeout: 60
257
258
  # if result.response?
258
259
  # p result.response
259
260
  # else
260
- # puts "Error!"
261
+ # puts "No response received."
261
262
  # end
262
263
  #
263
264
  def get_operation request, options = nil
@@ -537,14 +538,14 @@ module Google
537
538
  # # Call the wait_operation method.
538
539
  # result = client.wait_operation request
539
540
  #
540
- # # The returned object is of type Gapic::Operation. You can use this
541
- # # object to check the status of an operation, cancel it, or wait
542
- # # for results. Here is how to block until completion:
541
+ # # The returned object is of type Gapic::Operation. You can use it to
542
+ # # check the status of an operation, cancel it, or wait for results.
543
+ # # Here is how to wait for a response.
543
544
  # result.wait_until_done! timeout: 60
544
545
  # if result.response?
545
546
  # p result.response
546
547
  # else
547
- # puts "Error!"
548
+ # puts "No response received."
548
549
  # end
549
550
  #
550
551
  def wait_operation request, options = nil
@@ -564,6 +565,14 @@ module Google
564
565
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
565
566
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
566
567
 
568
+ header_params = {}
569
+ if request.name
570
+ header_params["name"] = request.name
571
+ end
572
+
573
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
574
+ metadata[:"x-goog-request-params"] ||= request_params_header
575
+
567
576
  options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
568
577
  metadata: metadata,
569
578
  retry_policy: @config.rpcs.wait_operation.retry_policy
@@ -47,7 +47,7 @@ module Google
47
47
  # On any input that is documented to expect a string parameter in
48
48
  # snake_case or dash-case, either of those cases is accepted.
49
49
  #
50
- # To load this service and instantiate a client:
50
+ # @example Load this service and instantiate a gRPC client
51
51
  #
52
52
  # require "google/cloud/automl/v1/automl"
53
53
  # client = ::Google::Cloud::AutoML::V1::AutoML::Client.new
@@ -1,10 +1,11 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/automl/v1/data_items.proto
3
3
 
4
+ require 'google/protobuf'
5
+
4
6
  require 'google/cloud/automl/v1/geometry_pb'
5
7
  require 'google/cloud/automl/v1/io_pb'
6
8
  require 'google/cloud/automl/v1/text_segment_pb'
7
- require 'google/protobuf'
8
9
 
9
10
  Google::Protobuf::DescriptorPool.generated_pool.build do
10
11
  add_file("google/cloud/automl/v1/data_items.proto", :syntax => :proto3) do
@@ -1,12 +1,13 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/automl/v1/dataset.proto
3
3
 
4
+ require 'google/protobuf'
5
+
4
6
  require 'google/api/resource_pb'
5
7
  require 'google/cloud/automl/v1/image_pb'
6
8
  require 'google/cloud/automl/v1/text_pb'
7
9
  require 'google/cloud/automl/v1/translation_pb'
8
10
  require 'google/protobuf/timestamp_pb'
9
- require 'google/protobuf'
10
11
 
11
12
  Google::Protobuf::DescriptorPool.generated_pool.build do
12
13
  add_file("google/cloud/automl/v1/dataset.proto", :syntax => :proto3) do
@@ -1,9 +1,10 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/automl/v1/detection.proto
3
3
 
4
- require 'google/cloud/automl/v1/geometry_pb'
5
4
  require 'google/protobuf'
6
5
 
6
+ require 'google/cloud/automl/v1/geometry_pb'
7
+
7
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
8
9
  add_file("google/cloud/automl/v1/detection.proto", :syntax => :proto3) do
9
10
  add_message "google.cloud.automl.v1.ImageObjectDetectionAnnotation" do
@@ -1,9 +1,10 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/automl/v1/image.proto
3
3
 
4
+ require 'google/protobuf'
5
+
4
6
  require 'google/api/field_behavior_pb'
5
7
  require 'google/cloud/automl/v1/classification_pb'
6
- require 'google/protobuf'
7
8
 
8
9
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
10
  add_file("google/cloud/automl/v1/image.proto", :syntax => :proto3) do
@@ -1,9 +1,10 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/automl/v1/io.proto
3
3
 
4
- require 'google/api/field_behavior_pb'
5
4
  require 'google/protobuf'
6
5
 
6
+ require 'google/api/field_behavior_pb'
7
+
7
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
8
9
  add_file("google/cloud/automl/v1/io.proto", :syntax => :proto3) do
9
10
  add_message "google.cloud.automl.v1.InputConfig" do
@@ -1,6 +1,8 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/automl/v1/model_evaluation.proto
3
3
 
4
+ require 'google/protobuf'
5
+
4
6
  require 'google/api/resource_pb'
5
7
  require 'google/cloud/automl/v1/classification_pb'
6
8
  require 'google/cloud/automl/v1/detection_pb'
@@ -8,7 +10,6 @@ require 'google/cloud/automl/v1/text_extraction_pb'
8
10
  require 'google/cloud/automl/v1/text_sentiment_pb'
9
11
  require 'google/cloud/automl/v1/translation_pb'
10
12
  require 'google/protobuf/timestamp_pb'
11
- require 'google/protobuf'
12
13
 
13
14
  Google::Protobuf::DescriptorPool.generated_pool.build do
14
15
  add_file("google/cloud/automl/v1/model_evaluation.proto", :syntax => :proto3) do
@@ -1,12 +1,13 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/automl/v1/model.proto
3
3
 
4
+ require 'google/protobuf'
5
+
4
6
  require 'google/api/resource_pb'
5
7
  require 'google/cloud/automl/v1/image_pb'
6
8
  require 'google/cloud/automl/v1/text_pb'
7
9
  require 'google/cloud/automl/v1/translation_pb'
8
10
  require 'google/protobuf/timestamp_pb'
9
- require 'google/protobuf'
10
11
 
11
12
  Google::Protobuf::DescriptorPool.generated_pool.build do
12
13
  add_file("google/cloud/automl/v1/model.proto", :syntax => :proto3) do
@@ -1,10 +1,11 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/automl/v1/operations.proto
3
3
 
4
+ require 'google/protobuf'
5
+
4
6
  require 'google/cloud/automl/v1/io_pb'
5
7
  require 'google/protobuf/timestamp_pb'
6
8
  require 'google/rpc/status_pb'
7
- require 'google/protobuf'
8
9
 
9
10
  Google::Protobuf::DescriptorPool.generated_pool.build do
10
11
  add_file("google/cloud/automl/v1/operations.proto", :syntax => :proto3) do
@@ -462,14 +462,14 @@ module Google
462
462
  # # Call the batch_predict method.
463
463
  # result = client.batch_predict request
464
464
  #
465
- # # The returned object is of type Gapic::Operation. You can use this
466
- # # object to check the status of an operation, cancel it, or wait
467
- # # for results. Here is how to block until completion:
465
+ # # The returned object is of type Gapic::Operation. You can use it to
466
+ # # check the status of an operation, cancel it, or wait for results.
467
+ # # Here is how to wait for a response.
468
468
  # result.wait_until_done! timeout: 60
469
469
  # if result.response?
470
470
  # p result.response
471
471
  # else
472
- # puts "Error!"
472
+ # puts "No response received."
473
473
  # end
474
474
  #
475
475
  def batch_predict request, options = nil
@@ -95,6 +95,9 @@ module Google
95
95
  channel_args: @config.channel_args,
96
96
  interceptors: @config.interceptors
97
97
  )
98
+
99
+ # Used by an LRO wrapper for some methods of this service
100
+ @operations_client = self
98
101
  end
99
102
 
100
103
  # Service calls
@@ -155,13 +158,11 @@ module Google
155
158
  # # Call the list_operations method.
156
159
  # result = client.list_operations request
157
160
  #
158
- # # The returned object is of type Gapic::PagedEnumerable. You can
159
- # # iterate over all elements by calling #each, and the enumerable
160
- # # will lazily make API calls to fetch subsequent pages. Other
161
- # # methods are also available for managing paging directly.
162
- # result.each do |response|
161
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
162
+ # # over elements, and API calls will be issued to fetch pages as needed.
163
+ # result.each do |item|
163
164
  # # Each element is of type ::Google::Longrunning::Operation.
164
- # p response
165
+ # p item
165
166
  # end
166
167
  #
167
168
  def list_operations request, options = nil
@@ -250,14 +251,14 @@ module Google
250
251
  # # Call the get_operation method.
251
252
  # result = client.get_operation request
252
253
  #
253
- # # The returned object is of type Gapic::Operation. You can use this
254
- # # object to check the status of an operation, cancel it, or wait
255
- # # for results. Here is how to block until completion:
254
+ # # The returned object is of type Gapic::Operation. You can use it to
255
+ # # check the status of an operation, cancel it, or wait for results.
256
+ # # Here is how to wait for a response.
256
257
  # result.wait_until_done! timeout: 60
257
258
  # if result.response?
258
259
  # p result.response
259
260
  # else
260
- # puts "Error!"
261
+ # puts "No response received."
261
262
  # end
262
263
  #
263
264
  def get_operation request, options = nil
@@ -537,14 +538,14 @@ module Google
537
538
  # # Call the wait_operation method.
538
539
  # result = client.wait_operation request
539
540
  #
540
- # # The returned object is of type Gapic::Operation. You can use this
541
- # # object to check the status of an operation, cancel it, or wait
542
- # # for results. Here is how to block until completion:
541
+ # # The returned object is of type Gapic::Operation. You can use it to
542
+ # # check the status of an operation, cancel it, or wait for results.
543
+ # # Here is how to wait for a response.
543
544
  # result.wait_until_done! timeout: 60
544
545
  # if result.response?
545
546
  # p result.response
546
547
  # else
547
- # puts "Error!"
548
+ # puts "No response received."
548
549
  # end
549
550
  #
550
551
  def wait_operation request, options = nil
@@ -564,6 +565,14 @@ module Google
564
565
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
565
566
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
566
567
 
568
+ header_params = {}
569
+ if request.name
570
+ header_params["name"] = request.name
571
+ end
572
+
573
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
574
+ metadata[:"x-goog-request-params"] ||= request_params_header
575
+
567
576
  options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
568
577
  metadata: metadata,
569
578
  retry_policy: @config.rpcs.wait_operation.retry_policy
@@ -37,7 +37,7 @@ module Google
37
37
  # On any input that is documented to expect a string parameter in
38
38
  # snake_case or dash-case, either of those cases is accepted.
39
39
  #
40
- # To load this service and instantiate a client:
40
+ # @example Load this service and instantiate a gRPC client
41
41
  #
42
42
  # require "google/cloud/automl/v1/prediction_service"
43
43
  # client = ::Google::Cloud::AutoML::V1::PredictionService::Client.new