google-cloud-vision-v1p4beta1 0.4.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/lib/google/cloud/vision/v1p4beta1/face_pb.rb +24 -13
  4. data/lib/google/cloud/vision/v1p4beta1/geometry_pb.rb +24 -18
  5. data/lib/google/cloud/vision/v1p4beta1/image_annotator/client.rb +6 -4
  6. data/lib/google/cloud/vision/v1p4beta1/image_annotator/operations.rb +5 -3
  7. data/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/client.rb +6 -4
  8. data/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/operations.rb +9 -7
  9. data/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/service_stub.rb +4 -4
  10. data/lib/google/cloud/vision/v1p4beta1/image_annotator_pb.rb +33 -269
  11. data/lib/google/cloud/vision/v1p4beta1/product_search/client.rb +6 -4
  12. data/lib/google/cloud/vision/v1p4beta1/product_search/operations.rb +5 -3
  13. data/lib/google/cloud/vision/v1p4beta1/product_search/rest/client.rb +6 -4
  14. data/lib/google/cloud/vision/v1p4beta1/product_search/rest/operations.rb +9 -7
  15. data/lib/google/cloud/vision/v1p4beta1/product_search/rest/service_stub.rb +19 -19
  16. data/lib/google/cloud/vision/v1p4beta1/product_search_pb.rb +27 -28
  17. data/lib/google/cloud/vision/v1p4beta1/product_search_service_pb.rb +28 -148
  18. data/lib/google/cloud/vision/v1p4beta1/text_annotation_pb.rb +25 -65
  19. data/lib/google/cloud/vision/v1p4beta1/version.rb +1 -1
  20. data/lib/google/cloud/vision/v1p4beta1/web_detection_pb.rb +24 -29
  21. data/proto_docs/google/api/client.rb +67 -4
  22. data/proto_docs/google/protobuf/any.rb +7 -4
  23. data/proto_docs/google/protobuf/timestamp.rb +1 -3
  24. metadata +7 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd08f67a504e79810a61bf1a27613f4d169d5e4e1ca46351adfebcc55923ebc6
4
- data.tar.gz: e5e01d9873455d58f69602139c9e9638c349cb78b83d900b0b949e59ff40d4fa
3
+ metadata.gz: f370201a606248d43c548d7441897b825425c66a825b2a03f5e95a1fd5a2946d
4
+ data.tar.gz: f7ef13de6359d5cd23501df29f496b99ecb7b017c977313fa31423cb9d8cbd0b
5
5
  SHA512:
6
- metadata.gz: f61fc036bce04b7ac6bc881cec134ad3e6e27f19a28b06e373524dfb0eff7e559d3fff5ea8af305604e4ddeca56c2489c308a0d90d1bfefd12e010d19925dba8
7
- data.tar.gz: '065639a173006648de77ee4f6d7bf14868473f29ae3b518cb0fdc6946136355dd14f555295d5631e77570a55d5fc909bb7d844ea4a42335dd765e762a7d6c690'
6
+ metadata.gz: 14a4aee95422ded5162fe879e8a3f35175f67e9842bcb492367ffcd3d428f4689d093ad854d1b050147e36f15ed9d4d336a2a391fe3553b117221439b2034825
7
+ data.tar.gz: bbc2fae0ee89bfafb9f3467351a648cda07bd66bb281453a8845364d21c7c584fac1a62be032471bd1908bbf395f966ad379eef1a7345b24a7262aea8ccfcb94
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ruby Client for the Cloud Vision V1p4beta1 API
2
2
 
3
- API Client library for the Cloud Vision V1p4beta1 API
3
+ Integrates Google Vision features, including image labeling, face, logo, and landmark detection, optical character recognition (OCR), and detection of explicit content, into applications.
4
4
 
5
5
  Cloud Vision API allows developers to easily integrate vision detection features within applications, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content.
6
6
 
@@ -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/vision/v1p4beta1/face.proto
3
4
 
@@ -5,21 +6,31 @@ require 'google/protobuf'
5
6
 
6
7
  require 'google/cloud/vision/v1p4beta1/geometry_pb'
7
8
 
8
- Google::Protobuf::DescriptorPool.generated_pool.build do
9
- add_file("google/cloud/vision/v1p4beta1/face.proto", :syntax => :proto3) do
10
- add_message "google.cloud.vision.v1p4beta1.FaceRecognitionParams" do
11
- repeated :celebrity_set, :string, 1
12
- end
13
- add_message "google.cloud.vision.v1p4beta1.Celebrity" do
14
- optional :name, :string, 1
15
- optional :display_name, :string, 2
16
- optional :description, :string, 3
17
- end
18
- add_message "google.cloud.vision.v1p4beta1.FaceRecognitionResult" do
19
- optional :celebrity, :message, 1, "google.cloud.vision.v1p4beta1.Celebrity"
20
- optional :confidence, :float, 2
9
+
10
+ descriptor_data = "\n(google/cloud/vision/v1p4beta1/face.proto\x12\x1dgoogle.cloud.vision.v1p4beta1\x1a,google/cloud/vision/v1p4beta1/geometry.proto\".\n\x15\x46\x61\x63\x65RecognitionParams\x12\x15\n\rcelebrity_set\x18\x01 \x03(\t\"D\n\tCelebrity\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\"h\n\x15\x46\x61\x63\x65RecognitionResult\x12;\n\tcelebrity\x18\x01 \x01(\x0b\x32(.google.cloud.vision.v1p4beta1.Celebrity\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x42z\n!com.google.cloud.vision.v1p4beta1B\x0e\x43\x65lebrityProtoP\x01Z9cloud.google.com/go/vision/apiv1p4beta1/visionpb;visionpb\xf8\x01\x01\xa2\x02\x04GCVNb\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}"
21
30
  end
22
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."
23
34
  end
24
35
 
25
36
  module Google
@@ -1,28 +1,34 @@
1
+ # frozen_string_literal: true
1
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
3
  # source: google/cloud/vision/v1p4beta1/geometry.proto
3
4
 
4
5
  require 'google/protobuf'
5
6
 
6
- Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_file("google/cloud/vision/v1p4beta1/geometry.proto", :syntax => :proto3) do
8
- add_message "google.cloud.vision.v1p4beta1.Vertex" do
9
- optional :x, :int32, 1
10
- optional :y, :int32, 2
11
- end
12
- add_message "google.cloud.vision.v1p4beta1.NormalizedVertex" do
13
- optional :x, :float, 1
14
- optional :y, :float, 2
15
- end
16
- add_message "google.cloud.vision.v1p4beta1.BoundingPoly" do
17
- repeated :vertices, :message, 1, "google.cloud.vision.v1p4beta1.Vertex"
18
- repeated :normalized_vertices, :message, 2, "google.cloud.vision.v1p4beta1.NormalizedVertex"
19
- end
20
- add_message "google.cloud.vision.v1p4beta1.Position" do
21
- optional :x, :float, 1
22
- optional :y, :float, 2
23
- optional :z, :float, 3
7
+
8
+ descriptor_data = "\n,google/cloud/vision/v1p4beta1/geometry.proto\x12\x1dgoogle.cloud.vision.v1p4beta1\"\x1e\n\x06Vertex\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\"(\n\x10NormalizedVertex\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\"\x95\x01\n\x0c\x42oundingPoly\x12\x37\n\x08vertices\x18\x01 \x03(\x0b\x32%.google.cloud.vision.v1p4beta1.Vertex\x12L\n\x13normalized_vertices\x18\x02 \x03(\x0b\x32/.google.cloud.vision.v1p4beta1.NormalizedVertex\"+\n\x08Position\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\x42y\n!com.google.cloud.vision.v1p4beta1B\rGeometryProtoP\x01Z9cloud.google.com/go/vision/apiv1p4beta1/visionpb;visionpb\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3"
9
+
10
+ pool = Google::Protobuf::DescriptorPool.generated_pool
11
+
12
+ begin
13
+ pool.add_serialized_file(descriptor_data)
14
+ rescue TypeError => e
15
+ # Compatibility code: will be removed in the next major version.
16
+ require 'google/protobuf/descriptor_pb'
17
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
18
+ parsed.clear_dependency
19
+ serialized = parsed.class.encode(parsed)
20
+ file = pool.add_serialized_file(serialized)
21
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
22
+ imports = [
23
+ ]
24
+ imports.each do |type_name, expected_filename|
25
+ import_file = pool.lookup(type_name).file_descriptor
26
+ if import_file.name != expected_filename
27
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
24
28
  end
25
29
  end
30
+ warn "Each proto file must use a consistent fully-qualified name."
31
+ warn "This will become an error in the next major version."
26
32
  end
27
33
 
28
34
  module Google
@@ -145,7 +145,7 @@ module Google
145
145
  credentials = @config.credentials
146
146
  # Use self-signed JWT if the endpoint is unchanged from default,
147
147
  # but only if the default endpoint does not have a region prefix.
148
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
148
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
149
149
  !@config.endpoint.split(".").first.include?("-")
150
150
  credentials ||= Credentials.default scope: @config.scope,
151
151
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -563,9 +563,9 @@ module Google
563
563
  # * (`String`) The path to a service account key file in JSON format
564
564
  # * (`Hash`) A service account key as a Hash
565
565
  # * (`Google::Auth::Credentials`) A googleauth credentials object
566
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
566
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
567
567
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
568
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
568
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
569
569
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
570
570
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
571
571
  # * (`nil`) indicating no credentials
@@ -607,7 +607,9 @@ module Google
607
607
  class Configuration
608
608
  extend ::Gapic::Config
609
609
 
610
- config_attr :endpoint, "vision.googleapis.com", ::String
610
+ DEFAULT_ENDPOINT = "vision.googleapis.com"
611
+
612
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
611
613
  config_attr :credentials, nil do |value|
612
614
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
613
615
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -620,9 +620,9 @@ module Google
620
620
  # * (`String`) The path to a service account key file in JSON format
621
621
  # * (`Hash`) A service account key as a Hash
622
622
  # * (`Google::Auth::Credentials`) A googleauth credentials object
623
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
623
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
624
624
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
625
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
625
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
626
626
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
627
627
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
628
628
  # * (`nil`) indicating no credentials
@@ -664,7 +664,9 @@ module Google
664
664
  class Configuration
665
665
  extend ::Gapic::Config
666
666
 
667
- config_attr :endpoint, "vision.googleapis.com", ::String
667
+ DEFAULT_ENDPOINT = "vision.googleapis.com"
668
+
669
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
668
670
  config_attr :credentials, nil do |value|
669
671
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
670
672
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -141,7 +141,7 @@ module Google
141
141
  credentials = @config.credentials
142
142
  # Use self-signed JWT if the endpoint is unchanged from default,
143
143
  # but only if the default endpoint does not have a region prefix.
144
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
144
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
145
145
  !@config.endpoint.split(".").first.include?("-")
146
146
  credentials ||= Credentials.default scope: @config.scope,
147
147
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -480,9 +480,9 @@ module Google
480
480
  # * (`String`) The path to a service account key file in JSON format
481
481
  # * (`Hash`) A service account key as a Hash
482
482
  # * (`Google::Auth::Credentials`) A googleauth credentials object
483
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
483
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
484
484
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
485
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
485
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
486
486
  # * (`nil`) indicating no credentials
487
487
  # @return [::Object]
488
488
  # @!attribute [rw] scope
@@ -515,7 +515,9 @@ module Google
515
515
  class Configuration
516
516
  extend ::Gapic::Config
517
517
 
518
- config_attr :endpoint, "vision.googleapis.com", ::String
518
+ DEFAULT_ENDPOINT = "vision.googleapis.com"
519
+
520
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
519
521
  config_attr :credentials, nil do |value|
520
522
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
521
523
  allowed.any? { |klass| klass === value }
@@ -411,9 +411,9 @@ module Google
411
411
  # * (`String`) The path to a service account key file in JSON format
412
412
  # * (`Hash`) A service account key as a Hash
413
413
  # * (`Google::Auth::Credentials`) A googleauth credentials object
414
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
414
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
415
415
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
416
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
416
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
417
417
  # * (`nil`) indicating no credentials
418
418
  # @return [::Object]
419
419
  # @!attribute [rw] scope
@@ -446,7 +446,9 @@ module Google
446
446
  class Configuration
447
447
  extend ::Gapic::Config
448
448
 
449
- config_attr :endpoint, "vision.googleapis.com", ::String
449
+ DEFAULT_ENDPOINT = "vision.googleapis.com"
450
+
451
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
450
452
  config_attr :credentials, nil do |value|
451
453
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
452
454
  allowed.any? { |klass| klass === value }
@@ -567,7 +569,7 @@ module Google
567
569
 
568
570
  verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb
569
571
  query_string_params = if query_string_params.any?
570
- query_string_params.to_h { |p| p.split("=", 2) }
572
+ query_string_params.to_h { |p| p.split "=", 2 }
571
573
  else
572
574
  {}
573
575
  end
@@ -605,7 +607,7 @@ module Google
605
607
 
606
608
  verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb
607
609
  query_string_params = if query_string_params.any?
608
- query_string_params.to_h { |p| p.split("=", 2) }
610
+ query_string_params.to_h { |p| p.split "=", 2 }
609
611
  else
610
612
  {}
611
613
  end
@@ -643,7 +645,7 @@ module Google
643
645
 
644
646
  verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb
645
647
  query_string_params = if query_string_params.any?
646
- query_string_params.to_h { |p| p.split("=", 2) }
648
+ query_string_params.to_h { |p| p.split "=", 2 }
647
649
  else
648
650
  {}
649
651
  end
@@ -681,7 +683,7 @@ module Google
681
683
 
682
684
  verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb
683
685
  query_string_params = if query_string_params.any?
684
- query_string_params.to_h { |p| p.split("=", 2) }
686
+ query_string_params.to_h { |p| p.split "=", 2 }
685
687
  else
686
688
  {}
687
689
  end
@@ -59,7 +59,7 @@ module Google
59
59
 
60
60
  verb, uri, query_string_params, body = ServiceStub.transcode_batch_annotate_images_request request_pb
61
61
  query_string_params = if query_string_params.any?
62
- query_string_params.to_h { |p| p.split("=", 2) }
62
+ query_string_params.to_h { |p| p.split "=", 2 }
63
63
  else
64
64
  {}
65
65
  end
@@ -97,7 +97,7 @@ module Google
97
97
 
98
98
  verb, uri, query_string_params, body = ServiceStub.transcode_batch_annotate_files_request request_pb
99
99
  query_string_params = if query_string_params.any?
100
- query_string_params.to_h { |p| p.split("=", 2) }
100
+ query_string_params.to_h { |p| p.split "=", 2 }
101
101
  else
102
102
  {}
103
103
  end
@@ -135,7 +135,7 @@ module Google
135
135
 
136
136
  verb, uri, query_string_params, body = ServiceStub.transcode_async_batch_annotate_images_request request_pb
137
137
  query_string_params = if query_string_params.any?
138
- query_string_params.to_h { |p| p.split("=", 2) }
138
+ query_string_params.to_h { |p| p.split "=", 2 }
139
139
  else
140
140
  {}
141
141
  end
@@ -173,7 +173,7 @@ module Google
173
173
 
174
174
  verb, uri, query_string_params, body = ServiceStub.transcode_async_batch_annotate_files_request request_pb
175
175
  query_string_params = if query_string_params.any?
176
- query_string_params.to_h { |p| p.split("=", 2) }
176
+ query_string_params.to_h { |p| p.split "=", 2 }
177
177
  else
178
178
  {}
179
179
  end