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.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/google/cloud/vision/v1p4beta1/face_pb.rb +24 -13
- data/lib/google/cloud/vision/v1p4beta1/geometry_pb.rb +24 -18
- data/lib/google/cloud/vision/v1p4beta1/image_annotator/client.rb +6 -4
- data/lib/google/cloud/vision/v1p4beta1/image_annotator/operations.rb +5 -3
- data/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/client.rb +6 -4
- data/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/operations.rb +9 -7
- data/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/service_stub.rb +4 -4
- data/lib/google/cloud/vision/v1p4beta1/image_annotator_pb.rb +33 -269
- data/lib/google/cloud/vision/v1p4beta1/product_search/client.rb +6 -4
- data/lib/google/cloud/vision/v1p4beta1/product_search/operations.rb +5 -3
- data/lib/google/cloud/vision/v1p4beta1/product_search/rest/client.rb +6 -4
- data/lib/google/cloud/vision/v1p4beta1/product_search/rest/operations.rb +9 -7
- data/lib/google/cloud/vision/v1p4beta1/product_search/rest/service_stub.rb +19 -19
- data/lib/google/cloud/vision/v1p4beta1/product_search_pb.rb +27 -28
- data/lib/google/cloud/vision/v1p4beta1/product_search_service_pb.rb +28 -148
- data/lib/google/cloud/vision/v1p4beta1/text_annotation_pb.rb +25 -65
- data/lib/google/cloud/vision/v1p4beta1/version.rb +1 -1
- data/lib/google/cloud/vision/v1p4beta1/web_detection_pb.rb +24 -29
- data/proto_docs/google/api/client.rb +67 -4
- data/proto_docs/google/protobuf/any.rb +7 -4
- data/proto_docs/google/protobuf/timestamp.rb +1 -3
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f370201a606248d43c548d7441897b825425c66a825b2a03f5e95a1fd5a2946d
|
4
|
+
data.tar.gz: f7ef13de6359d5cd23501df29f496b99ecb7b017c977313fa31423cb9d8cbd0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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://
|
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
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
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
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
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 ==
|
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://
|
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://
|
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
|
-
|
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://
|
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://
|
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
|
-
|
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 ==
|
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://
|
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://
|
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
|
-
|
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://
|
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://
|
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
|
-
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
176
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
177
177
|
else
|
178
178
|
{}
|
179
179
|
end
|