google-cloud-automl-v1 0.6.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/google/cloud/automl/v1/annotation_payload_pb.rb +29 -12
  4. data/lib/google/cloud/automl/v1/annotation_spec_pb.rb +24 -6
  5. data/lib/google/cloud/automl/v1/automl/client.rb +16 -5
  6. data/lib/google/cloud/automl/v1/automl/operations.rb +15 -4
  7. data/lib/google/cloud/automl/v1/automl/rest/client.rb +369 -4
  8. data/lib/google/cloud/automl/v1/automl/rest/operations.rb +108 -8
  9. data/lib/google/cloud/automl/v1/automl/rest/service_stub.rb +18 -18
  10. data/lib/google/cloud/automl/v1/classification_pb.rb +24 -41
  11. data/lib/google/cloud/automl/v1/data_items_pb.rb +27 -55
  12. data/lib/google/cloud/automl/v1/dataset_pb.rb +28 -18
  13. data/lib/google/cloud/automl/v1/detection_pb.rb +25 -21
  14. data/lib/google/cloud/automl/v1/geometry_pb.rb +24 -8
  15. data/lib/google/cloud/automl/v1/image_pb.rb +24 -29
  16. data/lib/google/cloud/automl/v1/io_pb.rb +24 -38
  17. data/lib/google/cloud/automl/v1/model_evaluation_pb.rb +30 -15
  18. data/lib/google/cloud/automl/v1/model_pb.rb +28 -24
  19. data/lib/google/cloud/automl/v1/operations_pb.rb +27 -53
  20. data/lib/google/cloud/automl/v1/prediction_service/client.rb +16 -5
  21. data/lib/google/cloud/automl/v1/prediction_service/operations.rb +15 -4
  22. data/lib/google/cloud/automl/v1/prediction_service/rest/client.rb +45 -4
  23. data/lib/google/cloud/automl/v1/prediction_service/rest/operations.rb +108 -8
  24. data/lib/google/cloud/automl/v1/prediction_service/rest/service_stub.rb +2 -2
  25. data/lib/google/cloud/automl/v1/prediction_service_pb.rb +27 -20
  26. data/lib/google/cloud/automl/v1/service_pb.rb +30 -87
  27. data/lib/google/cloud/automl/v1/text_extraction_pb.rb +25 -17
  28. data/lib/google/cloud/automl/v1/text_pb.rb +24 -16
  29. data/lib/google/cloud/automl/v1/text_segment_pb.rb +24 -6
  30. data/lib/google/cloud/automl/v1/text_sentiment_pb.rb +25 -14
  31. data/lib/google/cloud/automl/v1/translation_pb.rb +25 -17
  32. data/lib/google/cloud/automl/v1/version.rb +1 -1
  33. data/proto_docs/google/api/client.rb +67 -4
  34. data/proto_docs/google/api/field_behavior.rb +14 -0
  35. data/proto_docs/google/protobuf/any.rb +7 -4
  36. data/proto_docs/google/protobuf/timestamp.rb +1 -3
  37. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f2131e63e66e105f271d1a0a1cdf12a31903c28a412e89e79a54fe056424ebd9
4
- data.tar.gz: 5d806a357a92ed7b5371072d514a8b9d20e0bd568c8683f9ac3942b7f6661e2a
3
+ metadata.gz: cf74d6ebc5cdec045f82b197b5017327b95a2d8edb8676a50dde565ec4d96751
4
+ data.tar.gz: 772f9a6d220bbe5d7d8274b59c1c4ac115a02f1f86e695e1c2642ccdb774d0b4
5
5
  SHA512:
6
- metadata.gz: e2d5a8030cb6b934caa71b17490592b09966722e9221c68e083a1dfff8ead5cdc921e924eb082a631e8aa4d92938a9eafe28c0cc388fb8573816398fbf0c586d
7
- data.tar.gz: 848b0c7a9f8ea335e30e8c6b89745cb673d2a02d3af6bbbc247ed0477f2f2a1239e3289f2cd80cd77cc67dcb957e8efe5ad8ec0dcdf67c693affbfef5474a468
6
+ metadata.gz: ba9d8cb1d3dfd6d2389a3badf760860690617868c78de5f17c5d942963411843583d12a31bcca22ce531637b869db118b557e1044b1fc194ac0a04cce38b9e76
7
+ data.tar.gz: a75810f8027bfaead42b09ef67a8bf27ddf7d2da3b6952f6503671e631363cfa1c2a2b5cb7ac2b8f27c87566518316dd72eeae94a61c702e00a46525f06ec6a7
data/README.md CHANGED
@@ -47,7 +47,7 @@ for general usage information.
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
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
- or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
50
+ or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/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.
53
53
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
3
  # source: google/cloud/automl/v1/annotation_payload.proto
3
4
 
@@ -9,20 +10,36 @@ require 'google/cloud/automl/v1/text_extraction_pb'
9
10
  require 'google/cloud/automl/v1/text_sentiment_pb'
10
11
  require 'google/cloud/automl/v1/translation_pb'
11
12
 
12
- Google::Protobuf::DescriptorPool.generated_pool.build do
13
- add_file("google/cloud/automl/v1/annotation_payload.proto", :syntax => :proto3) do
14
- add_message "google.cloud.automl.v1.AnnotationPayload" do
15
- optional :annotation_spec_id, :string, 1
16
- optional :display_name, :string, 5
17
- oneof :detail do
18
- optional :translation, :message, 2, "google.cloud.automl.v1.TranslationAnnotation"
19
- optional :classification, :message, 3, "google.cloud.automl.v1.ClassificationAnnotation"
20
- optional :image_object_detection, :message, 4, "google.cloud.automl.v1.ImageObjectDetectionAnnotation"
21
- optional :text_extraction, :message, 6, "google.cloud.automl.v1.TextExtractionAnnotation"
22
- optional :text_sentiment, :message, 7, "google.cloud.automl.v1.TextSentimentAnnotation"
23
- end
13
+
14
+ descriptor_data = "\n/google/cloud/automl/v1/annotation_payload.proto\x12\x16google.cloud.automl.v1\x1a+google/cloud/automl/v1/classification.proto\x1a&google/cloud/automl/v1/detection.proto\x1a,google/cloud/automl/v1/text_extraction.proto\x1a+google/cloud/automl/v1/text_sentiment.proto\x1a(google/cloud/automl/v1/translation.proto\"\xd3\x03\n\x11\x41nnotationPayload\x12\x44\n\x0btranslation\x18\x02 \x01(\x0b\x32-.google.cloud.automl.v1.TranslationAnnotationH\x00\x12J\n\x0e\x63lassification\x18\x03 \x01(\x0b\x32\x30.google.cloud.automl.v1.ClassificationAnnotationH\x00\x12X\n\x16image_object_detection\x18\x04 \x01(\x0b\x32\x36.google.cloud.automl.v1.ImageObjectDetectionAnnotationH\x00\x12K\n\x0ftext_extraction\x18\x06 \x01(\x0b\x32\x30.google.cloud.automl.v1.TextExtractionAnnotationH\x00\x12I\n\x0etext_sentiment\x18\x07 \x01(\x0b\x32/.google.cloud.automl.v1.TextSentimentAnnotationH\x00\x12\x1a\n\x12\x61nnotation_spec_id\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x05 \x01(\tB\x08\n\x06\x64\x65tailB\xa0\x01\n\x1a\x63om.google.cloud.automl.v1P\x01Z2cloud.google.com/go/automl/apiv1/automlpb;automlpb\xaa\x02\x16Google.Cloud.AutoML.V1\xca\x02\x16Google\\Cloud\\AutoMl\\V1\xea\x02\x19Google::Cloud::AutoML::V1b\x06proto3"
15
+
16
+ pool = Google::Protobuf::DescriptorPool.generated_pool
17
+
18
+ begin
19
+ pool.add_serialized_file(descriptor_data)
20
+ rescue TypeError => e
21
+ # Compatibility code: will be removed in the next major version.
22
+ require 'google/protobuf/descriptor_pb'
23
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
24
+ parsed.clear_dependency
25
+ serialized = parsed.class.encode(parsed)
26
+ file = pool.add_serialized_file(serialized)
27
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
28
+ imports = [
29
+ ["google.cloud.automl.v1.TranslationAnnotation", "google/cloud/automl/v1/translation.proto"],
30
+ ["google.cloud.automl.v1.ClassificationAnnotation", "google/cloud/automl/v1/classification.proto"],
31
+ ["google.cloud.automl.v1.ImageObjectDetectionAnnotation", "google/cloud/automl/v1/detection.proto"],
32
+ ["google.cloud.automl.v1.TextExtractionAnnotation", "google/cloud/automl/v1/text_extraction.proto"],
33
+ ["google.cloud.automl.v1.TextSentimentAnnotation", "google/cloud/automl/v1/text_sentiment.proto"],
34
+ ]
35
+ imports.each do |type_name, expected_filename|
36
+ import_file = pool.lookup(type_name).file_descriptor
37
+ if import_file.name != expected_filename
38
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
24
39
  end
25
40
  end
41
+ warn "Each proto file must use a consistent fully-qualified name."
42
+ warn "This will become an error in the next major version."
26
43
  end
27
44
 
28
45
  module Google
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
3
  # source: google/cloud/automl/v1/annotation_spec.proto
3
4
 
@@ -5,14 +6,31 @@ require 'google/protobuf'
5
6
 
6
7
  require 'google/api/resource_pb'
7
8
 
8
- Google::Protobuf::DescriptorPool.generated_pool.build do
9
- add_file("google/cloud/automl/v1/annotation_spec.proto", :syntax => :proto3) do
10
- add_message "google.cloud.automl.v1.AnnotationSpec" do
11
- optional :name, :string, 1
12
- optional :display_name, :string, 2
13
- optional :example_count, :int32, 9
9
+
10
+ descriptor_data = "\n,google/cloud/automl/v1/annotation_spec.proto\x12\x16google.cloud.automl.v1\x1a\x19google/api/resource.proto\"\xd6\x01\n\x0e\x41nnotationSpec\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x15\n\rexample_count\x18\t \x01(\x05:\x88\x01\xea\x41\x84\x01\n$automl.googleapis.com/AnnotationSpec\x12\\projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}B\xa0\x01\n\x1a\x63om.google.cloud.automl.v1P\x01Z2cloud.google.com/go/automl/apiv1/automlpb;automlpb\xaa\x02\x16Google.Cloud.AutoML.V1\xca\x02\x16Google\\Cloud\\AutoMl\\V1\xea\x02\x19Google::Cloud::AutoML::V1b\x06proto3"
11
+
12
+ pool = Google::Protobuf::DescriptorPool.generated_pool
13
+
14
+ begin
15
+ pool.add_serialized_file(descriptor_data)
16
+ rescue TypeError => e
17
+ # Compatibility code: will be removed in the next major version.
18
+ require 'google/protobuf/descriptor_pb'
19
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
20
+ parsed.clear_dependency
21
+ serialized = parsed.class.encode(parsed)
22
+ file = pool.add_serialized_file(serialized)
23
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
24
+ imports = [
25
+ ]
26
+ imports.each do |type_name, expected_filename|
27
+ import_file = pool.lookup(type_name).file_descriptor
28
+ if import_file.name != expected_filename
29
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
14
30
  end
15
31
  end
32
+ warn "Each proto file must use a consistent fully-qualified name."
33
+ warn "This will become an error in the next major version."
16
34
  end
17
35
 
18
36
  module Google
@@ -199,7 +199,7 @@ module Google
199
199
  credentials = @config.credentials
200
200
  # Use self-signed JWT if the endpoint is unchanged from default,
201
201
  # but only if the default endpoint does not have a region prefix.
202
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
202
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
203
203
  !@config.endpoint.split(".").first.include?("-")
204
204
  credentials ||= Credentials.default scope: @config.scope,
205
205
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -220,7 +220,8 @@ module Google
220
220
  credentials: credentials,
221
221
  endpoint: @config.endpoint,
222
222
  channel_args: @config.channel_args,
223
- interceptors: @config.interceptors
223
+ interceptors: @config.interceptors,
224
+ channel_pool_config: @config.channel_pool
224
225
  )
225
226
  end
226
227
 
@@ -2006,9 +2007,9 @@ module Google
2006
2007
  # * (`String`) The path to a service account key file in JSON format
2007
2008
  # * (`Hash`) A service account key as a Hash
2008
2009
  # * (`Google::Auth::Credentials`) A googleauth credentials object
2009
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
2010
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
2010
2011
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2011
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
2012
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
2012
2013
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
2013
2014
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
2014
2015
  # * (`nil`) indicating no credentials
@@ -2050,7 +2051,9 @@ module Google
2050
2051
  class Configuration
2051
2052
  extend ::Gapic::Config
2052
2053
 
2053
- config_attr :endpoint, "automl.googleapis.com", ::String
2054
+ DEFAULT_ENDPOINT = "automl.googleapis.com"
2055
+
2056
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
2054
2057
  config_attr :credentials, nil do |value|
2055
2058
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2056
2059
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -2085,6 +2088,14 @@ module Google
2085
2088
  end
2086
2089
  end
2087
2090
 
2091
+ ##
2092
+ # Configuration for the channel pool
2093
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
2094
+ #
2095
+ def channel_pool
2096
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
2097
+ end
2098
+
2088
2099
  ##
2089
2100
  # Configuration RPC class for the AutoMl API.
2090
2101
  #
@@ -93,7 +93,8 @@ module Google
93
93
  credentials: credentials,
94
94
  endpoint: @config.endpoint,
95
95
  channel_args: @config.channel_args,
96
- interceptors: @config.interceptors
96
+ interceptors: @config.interceptors,
97
+ channel_pool_config: @config.channel_pool
97
98
  )
98
99
 
99
100
  # Used by an LRO wrapper for some methods of this service
@@ -628,9 +629,9 @@ module Google
628
629
  # * (`String`) The path to a service account key file in JSON format
629
630
  # * (`Hash`) A service account key as a Hash
630
631
  # * (`Google::Auth::Credentials`) A googleauth credentials object
631
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
632
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
632
633
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
633
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
634
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
634
635
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
635
636
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
636
637
  # * (`nil`) indicating no credentials
@@ -672,7 +673,9 @@ module Google
672
673
  class Configuration
673
674
  extend ::Gapic::Config
674
675
 
675
- config_attr :endpoint, "automl.googleapis.com", ::String
676
+ DEFAULT_ENDPOINT = "automl.googleapis.com"
677
+
678
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
676
679
  config_attr :credentials, nil do |value|
677
680
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
678
681
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -707,6 +710,14 @@ module Google
707
710
  end
708
711
  end
709
712
 
713
+ ##
714
+ # Configuration for the channel pool
715
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
716
+ #
717
+ def channel_pool
718
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
719
+ end
720
+
710
721
  ##
711
722
  # Configuration RPC class for the Operations API.
712
723
  #