google-cloud-automl-v1beta1 0.6.0 → 0.7.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.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/README.md +2 -2
  4. data/lib/google/cloud/automl/v1beta1/annotation_payload_pb.rb +0 -2
  5. data/lib/google/cloud/automl/v1beta1/annotation_spec_pb.rb +0 -1
  6. data/lib/google/cloud/automl/v1beta1/automl/client.rb +56 -66
  7. data/lib/google/cloud/automl/v1beta1/automl/operations.rb +20 -14
  8. data/lib/google/cloud/automl/v1beta1/automl/rest/client.rb +2222 -0
  9. data/lib/google/cloud/automl/v1beta1/automl/rest/operations.rb +935 -0
  10. data/lib/google/cloud/automl/v1beta1/automl/rest/service_stub.rb +1475 -0
  11. data/lib/google/cloud/automl/v1beta1/automl/rest.rb +66 -0
  12. data/lib/google/cloud/automl/v1beta1/automl.rb +7 -1
  13. data/lib/google/cloud/automl/v1beta1/classification_pb.rb +0 -1
  14. data/lib/google/cloud/automl/v1beta1/column_spec_pb.rb +0 -1
  15. data/lib/google/cloud/automl/v1beta1/data_items_pb.rb +0 -3
  16. data/lib/google/cloud/automl/v1beta1/data_stats_pb.rb +0 -2
  17. data/lib/google/cloud/automl/v1beta1/data_types_pb.rb +0 -2
  18. data/lib/google/cloud/automl/v1beta1/dataset_pb.rb +0 -1
  19. data/lib/google/cloud/automl/v1beta1/detection_pb.rb +0 -1
  20. data/lib/google/cloud/automl/v1beta1/geometry_pb.rb +0 -2
  21. data/lib/google/cloud/automl/v1beta1/image_pb.rb +0 -3
  22. data/lib/google/cloud/automl/v1beta1/io_pb.rb +0 -2
  23. data/lib/google/cloud/automl/v1beta1/model_evaluation_pb.rb +0 -1
  24. data/lib/google/cloud/automl/v1beta1/model_pb.rb +0 -1
  25. data/lib/google/cloud/automl/v1beta1/operations_pb.rb +0 -2
  26. data/lib/google/cloud/automl/v1beta1/prediction_service/client.rb +4 -4
  27. data/lib/google/cloud/automl/v1beta1/prediction_service/operations.rb +20 -14
  28. data/lib/google/cloud/automl/v1beta1/prediction_service/rest/client.rb +563 -0
  29. data/lib/google/cloud/automl/v1beta1/prediction_service/rest/operations.rb +935 -0
  30. data/lib/google/cloud/automl/v1beta1/prediction_service/rest/service_stub.rb +168 -0
  31. data/lib/google/cloud/automl/v1beta1/prediction_service/rest.rb +56 -0
  32. data/lib/google/cloud/automl/v1beta1/prediction_service.rb +7 -1
  33. data/lib/google/cloud/automl/v1beta1/ranges_pb.rb +0 -2
  34. data/lib/google/cloud/automl/v1beta1/regression_pb.rb +0 -2
  35. data/lib/google/cloud/automl/v1beta1/rest.rb +38 -0
  36. data/lib/google/cloud/automl/v1beta1/table_spec_pb.rb +0 -1
  37. data/lib/google/cloud/automl/v1beta1/tables_pb.rb +0 -1
  38. data/lib/google/cloud/automl/v1beta1/temporal_pb.rb +0 -1
  39. data/lib/google/cloud/automl/v1beta1/text_extraction_pb.rb +0 -1
  40. data/lib/google/cloud/automl/v1beta1/text_pb.rb +0 -1
  41. data/lib/google/cloud/automl/v1beta1/text_segment_pb.rb +0 -2
  42. data/lib/google/cloud/automl/v1beta1/text_sentiment_pb.rb +0 -1
  43. data/lib/google/cloud/automl/v1beta1/translation_pb.rb +0 -1
  44. data/lib/google/cloud/automl/v1beta1/version.rb +1 -1
  45. data/lib/google/cloud/automl/v1beta1/video_pb.rb +0 -1
  46. data/lib/google/cloud/automl/v1beta1.rb +7 -2
  47. data/proto_docs/google/api/client.rb +318 -0
  48. data/proto_docs/google/api/launch_stage.rb +71 -0
  49. data/proto_docs/google/protobuf/empty.rb +0 -2
  50. data/proto_docs/google/rpc/status.rb +4 -2
  51. metadata +20 -8
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/automl/v1beta1/version"
24
+
25
+ require "google/cloud/automl/v1beta1/automl/credentials"
26
+ require "google/cloud/automl/v1beta1/automl/paths"
27
+ require "google/cloud/automl/v1beta1/automl/rest/operations"
28
+ require "google/cloud/automl/v1beta1/automl/rest/client"
29
+
30
+ module Google
31
+ module Cloud
32
+ module AutoML
33
+ module V1beta1
34
+ ##
35
+ # AutoML Server API.
36
+ #
37
+ # The resource names are assigned by the server.
38
+ # The server never reuses names that it has created after the resources with
39
+ # those names are deleted.
40
+ #
41
+ # An ID of a resource is the last element of the item's resource name. For
42
+ # `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then
43
+ # the id for the item is `{dataset_id}`.
44
+ #
45
+ # Currently the only supported `location_id` is "us-central1".
46
+ #
47
+ # On any input that is documented to expect a string parameter in
48
+ # snake_case or kebab-case, either of those cases is accepted.
49
+ #
50
+ # To load this service and instantiate a REST client:
51
+ #
52
+ # require "google/cloud/automl/v1beta1/automl/rest"
53
+ # client = ::Google::Cloud::AutoML::V1beta1::AutoML::Rest::Client.new
54
+ #
55
+ module AutoML
56
+ # Client for the REST transport
57
+ module Rest
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+
65
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
66
+ require "google/cloud/automl/v1beta1/automl/rest/helpers" if ::File.file? helper_path
@@ -26,6 +26,7 @@ require "google/cloud/automl/v1beta1/automl/credentials"
26
26
  require "google/cloud/automl/v1beta1/automl/paths"
27
27
  require "google/cloud/automl/v1beta1/automl/operations"
28
28
  require "google/cloud/automl/v1beta1/automl/client"
29
+ require "google/cloud/automl/v1beta1/automl/rest"
29
30
 
30
31
  module Google
31
32
  module Cloud
@@ -47,11 +48,16 @@ module Google
47
48
  # On any input that is documented to expect a string parameter in
48
49
  # snake_case or kebab-case, either of those cases is accepted.
49
50
  #
50
- # To load this service and instantiate a client:
51
+ # @example Load this service and instantiate a gRPC client
51
52
  #
52
53
  # require "google/cloud/automl/v1beta1/automl"
53
54
  # client = ::Google::Cloud::AutoML::V1beta1::AutoML::Client.new
54
55
  #
56
+ # @example Load this service and instantiate a REST client
57
+ #
58
+ # require "google/cloud/automl/v1beta1/automl/rest"
59
+ # client = ::Google::Cloud::AutoML::V1beta1::AutoML::Rest::Client.new
60
+ #
55
61
  module AutoML
56
62
  end
57
63
  end
@@ -4,7 +4,6 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  require 'google/cloud/automl/v1beta1/temporal_pb'
7
- require 'google/api/annotations_pb'
8
7
 
9
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
10
9
  add_file("google/cloud/automl/v1beta1/classification.proto", :syntax => :proto3) do
@@ -6,7 +6,6 @@ require 'google/protobuf'
6
6
  require 'google/api/resource_pb'
7
7
  require 'google/cloud/automl/v1beta1/data_stats_pb'
8
8
  require 'google/cloud/automl/v1beta1/data_types_pb'
9
- require 'google/api/annotations_pb'
10
9
 
11
10
  Google::Protobuf::DescriptorPool.generated_pool.build do
12
11
  add_file("google/cloud/automl/v1beta1/column_spec.proto", :syntax => :proto3) do
@@ -7,10 +7,7 @@ require 'google/cloud/automl/v1beta1/geometry_pb'
7
7
  require 'google/cloud/automl/v1beta1/io_pb'
8
8
  require 'google/cloud/automl/v1beta1/temporal_pb'
9
9
  require 'google/cloud/automl/v1beta1/text_segment_pb'
10
- require 'google/protobuf/any_pb'
11
- require 'google/protobuf/duration_pb'
12
10
  require 'google/protobuf/struct_pb'
13
- require 'google/api/annotations_pb'
14
11
 
15
12
  Google::Protobuf::DescriptorPool.generated_pool.build do
16
13
  add_file("google/cloud/automl/v1beta1/data_items.proto", :syntax => :proto3) do
@@ -3,8 +3,6 @@
3
3
 
4
4
  require 'google/protobuf'
5
5
 
6
- require 'google/api/annotations_pb'
7
-
8
6
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
7
  add_file("google/cloud/automl/v1beta1/data_stats.proto", :syntax => :proto3) do
10
8
  add_message "google.cloud.automl.v1beta1.DataStats" do
@@ -3,8 +3,6 @@
3
3
 
4
4
  require 'google/protobuf'
5
5
 
6
- require 'google/api/annotations_pb'
7
-
8
6
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
7
  add_file("google/cloud/automl/v1beta1/data_types.proto", :syntax => :proto3) do
10
8
  add_message "google.cloud.automl.v1beta1.DataType" do
@@ -10,7 +10,6 @@ require 'google/cloud/automl/v1beta1/text_pb'
10
10
  require 'google/cloud/automl/v1beta1/translation_pb'
11
11
  require 'google/cloud/automl/v1beta1/video_pb'
12
12
  require 'google/protobuf/timestamp_pb'
13
- require 'google/api/annotations_pb'
14
13
 
15
14
  Google::Protobuf::DescriptorPool.generated_pool.build do
16
15
  add_file("google/cloud/automl/v1beta1/dataset.proto", :syntax => :proto3) do
@@ -5,7 +5,6 @@ require 'google/protobuf'
5
5
 
6
6
  require 'google/cloud/automl/v1beta1/geometry_pb'
7
7
  require 'google/protobuf/duration_pb'
8
- require 'google/api/annotations_pb'
9
8
 
10
9
  Google::Protobuf::DescriptorPool.generated_pool.build do
11
10
  add_file("google/cloud/automl/v1beta1/detection.proto", :syntax => :proto3) do
@@ -3,8 +3,6 @@
3
3
 
4
4
  require 'google/protobuf'
5
5
 
6
- require 'google/api/annotations_pb'
7
-
8
6
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
7
  add_file("google/cloud/automl/v1beta1/geometry.proto", :syntax => :proto3) do
10
8
  add_message "google.cloud.automl.v1beta1.NormalizedVertex" do
@@ -3,11 +3,8 @@
3
3
 
4
4
  require 'google/protobuf'
5
5
 
6
- require 'google/api/resource_pb'
7
6
  require 'google/cloud/automl/v1beta1/annotation_spec_pb'
8
7
  require 'google/cloud/automl/v1beta1/classification_pb'
9
- require 'google/protobuf/timestamp_pb'
10
- require 'google/api/annotations_pb'
11
8
 
12
9
  Google::Protobuf::DescriptorPool.generated_pool.build do
13
10
  add_file("google/cloud/automl/v1beta1/image.proto", :syntax => :proto3) do
@@ -3,8 +3,6 @@
3
3
 
4
4
  require 'google/protobuf'
5
5
 
6
- require 'google/api/annotations_pb'
7
-
8
6
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
7
  add_file("google/cloud/automl/v1beta1/io.proto", :syntax => :proto3) do
10
8
  add_message "google.cloud.automl.v1beta1.InputConfig" do
@@ -12,7 +12,6 @@ require 'google/cloud/automl/v1beta1/text_extraction_pb'
12
12
  require 'google/cloud/automl/v1beta1/text_sentiment_pb'
13
13
  require 'google/cloud/automl/v1beta1/translation_pb'
14
14
  require 'google/protobuf/timestamp_pb'
15
- require 'google/api/annotations_pb'
16
15
 
17
16
  Google::Protobuf::DescriptorPool.generated_pool.build do
18
17
  add_file("google/cloud/automl/v1beta1/model_evaluation.proto", :syntax => :proto3) do
@@ -10,7 +10,6 @@ require 'google/cloud/automl/v1beta1/text_pb'
10
10
  require 'google/cloud/automl/v1beta1/translation_pb'
11
11
  require 'google/cloud/automl/v1beta1/video_pb'
12
12
  require 'google/protobuf/timestamp_pb'
13
- require 'google/api/annotations_pb'
14
13
 
15
14
  Google::Protobuf::DescriptorPool.generated_pool.build do
16
15
  add_file("google/cloud/automl/v1beta1/model.proto", :syntax => :proto3) do
@@ -6,10 +6,8 @@ require 'google/protobuf'
6
6
  require 'google/cloud/automl/v1beta1/io_pb'
7
7
  require 'google/cloud/automl/v1beta1/model_pb'
8
8
  require 'google/cloud/automl/v1beta1/model_evaluation_pb'
9
- require 'google/protobuf/empty_pb'
10
9
  require 'google/protobuf/timestamp_pb'
11
10
  require 'google/rpc/status_pb'
12
- require 'google/api/annotations_pb'
13
11
 
14
12
  Google::Protobuf::DescriptorPool.generated_pool.build do
15
13
  add_file("google/cloud/automl/v1beta1/operations.proto", :syntax => :proto3) do
@@ -419,14 +419,14 @@ module Google
419
419
  # # Call the batch_predict method.
420
420
  # result = client.batch_predict request
421
421
  #
422
- # # The returned object is of type Gapic::Operation. You can use this
423
- # # object to check the status of an operation, cancel it, or wait
424
- # # for results. Here is how to block until completion:
422
+ # # The returned object is of type Gapic::Operation. You can use it to
423
+ # # check the status of an operation, cancel it, or wait for results.
424
+ # # Here is how to wait for a response.
425
425
  # result.wait_until_done! timeout: 60
426
426
  # if result.response?
427
427
  # p result.response
428
428
  # else
429
- # puts "Error!"
429
+ # puts "No response received."
430
430
  # end
431
431
  #
432
432
  def batch_predict request, options = nil
@@ -158,13 +158,11 @@ module Google
158
158
  # # Call the list_operations method.
159
159
  # result = client.list_operations request
160
160
  #
161
- # # The returned object is of type Gapic::PagedEnumerable. You can
162
- # # iterate over all elements by calling #each, and the enumerable
163
- # # will lazily make API calls to fetch subsequent pages. Other
164
- # # methods are also available for managing paging directly.
165
- # 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|
166
164
  # # Each element is of type ::Google::Longrunning::Operation.
167
- # p response
165
+ # p item
168
166
  # end
169
167
  #
170
168
  def list_operations request, options = nil
@@ -253,14 +251,14 @@ module Google
253
251
  # # Call the get_operation method.
254
252
  # result = client.get_operation request
255
253
  #
256
- # # The returned object is of type Gapic::Operation. You can use this
257
- # # object to check the status of an operation, cancel it, or wait
258
- # # 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.
259
257
  # result.wait_until_done! timeout: 60
260
258
  # if result.response?
261
259
  # p result.response
262
260
  # else
263
- # puts "Error!"
261
+ # puts "No response received."
264
262
  # end
265
263
  #
266
264
  def get_operation request, options = nil
@@ -540,14 +538,14 @@ module Google
540
538
  # # Call the wait_operation method.
541
539
  # result = client.wait_operation request
542
540
  #
543
- # # The returned object is of type Gapic::Operation. You can use this
544
- # # object to check the status of an operation, cancel it, or wait
545
- # # 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.
546
544
  # result.wait_until_done! timeout: 60
547
545
  # if result.response?
548
546
  # p result.response
549
547
  # else
550
- # puts "Error!"
548
+ # puts "No response received."
551
549
  # end
552
550
  #
553
551
  def wait_operation request, options = nil
@@ -567,6 +565,14 @@ module Google
567
565
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
568
566
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
569
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
+
570
576
  options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
571
577
  metadata: metadata,
572
578
  retry_policy: @config.rpcs.wait_operation.retry_policy