google-cloud-vision 0.32.2 → 1.1.3

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 (69) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +4 -2
  3. data/AUTHENTICATION.md +151 -0
  4. data/LICENSE.md +201 -0
  5. data/MIGRATING.md +343 -0
  6. data/README.md +97 -52
  7. data/lib/google/cloud/vision/{v1/doc/google/protobuf/empty.rb → version.rb} +10 -13
  8. data/lib/google/cloud/vision.rb +132 -207
  9. data/lib/{google/cloud/vision/v1p3beta1/doc/google/protobuf/empty.rb → google-cloud-vision.rb} +5 -15
  10. metadata +108 -83
  11. data/LICENSE +0 -201
  12. data/lib/google/cloud/vision/v1/credentials.rb +0 -42
  13. data/lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/geometry.rb +0 -66
  14. data/lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/image_annotator.rb +0 -763
  15. data/lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/product_search.rb +0 -88
  16. data/lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/product_search_service.rb +0 -539
  17. data/lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/text_annotation.rb +0 -254
  18. data/lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/web_detection.rb +0 -102
  19. data/lib/google/cloud/vision/v1/doc/google/longrunning/operations.rb +0 -93
  20. data/lib/google/cloud/vision/v1/doc/google/protobuf/any.rb +0 -130
  21. data/lib/google/cloud/vision/v1/doc/google/protobuf/field_mask.rb +0 -230
  22. data/lib/google/cloud/vision/v1/doc/google/protobuf/timestamp.rb +0 -109
  23. data/lib/google/cloud/vision/v1/doc/google/protobuf/wrappers.rb +0 -90
  24. data/lib/google/cloud/vision/v1/doc/google/rpc/status.rb +0 -84
  25. data/lib/google/cloud/vision/v1/doc/google/type/color.rb +0 -156
  26. data/lib/google/cloud/vision/v1/doc/google/type/latlng.rb +0 -65
  27. data/lib/google/cloud/vision/v1/geometry_pb.rb +0 -39
  28. data/lib/google/cloud/vision/v1/helpers.rb +0 -1154
  29. data/lib/google/cloud/vision/v1/image_annotator_client.rb +0 -302
  30. data/lib/google/cloud/vision/v1/image_annotator_client_config.json +0 -36
  31. data/lib/google/cloud/vision/v1/image_annotator_pb.rb +0 -305
  32. data/lib/google/cloud/vision/v1/image_annotator_services_pb.rb +0 -56
  33. data/lib/google/cloud/vision/v1/product_search_client.rb +0 -1337
  34. data/lib/google/cloud/vision/v1/product_search_client_config.json +0 -116
  35. data/lib/google/cloud/vision/v1/product_search_pb.rb +0 -45
  36. data/lib/google/cloud/vision/v1/product_search_service_pb.rb +0 -191
  37. data/lib/google/cloud/vision/v1/product_search_service_services_pb.rb +0 -224
  38. data/lib/google/cloud/vision/v1/text_annotation_pb.rb +0 -94
  39. data/lib/google/cloud/vision/v1/web_detection_pb.rb +0 -51
  40. data/lib/google/cloud/vision/v1.rb +0 -233
  41. data/lib/google/cloud/vision/v1p3beta1/credentials.rb +0 -42
  42. data/lib/google/cloud/vision/v1p3beta1/doc/google/cloud/vision/v1p3beta1/geometry.rb +0 -72
  43. data/lib/google/cloud/vision/v1p3beta1/doc/google/cloud/vision/v1p3beta1/image_annotator.rb +0 -763
  44. data/lib/google/cloud/vision/v1p3beta1/doc/google/cloud/vision/v1p3beta1/product_search.rb +0 -154
  45. data/lib/google/cloud/vision/v1p3beta1/doc/google/cloud/vision/v1p3beta1/product_search_service.rb +0 -533
  46. data/lib/google/cloud/vision/v1p3beta1/doc/google/cloud/vision/v1p3beta1/text_annotation.rb +0 -254
  47. data/lib/google/cloud/vision/v1p3beta1/doc/google/cloud/vision/v1p3beta1/web_detection.rb +0 -101
  48. data/lib/google/cloud/vision/v1p3beta1/doc/google/longrunning/operations.rb +0 -93
  49. data/lib/google/cloud/vision/v1p3beta1/doc/google/protobuf/any.rb +0 -130
  50. data/lib/google/cloud/vision/v1p3beta1/doc/google/protobuf/field_mask.rb +0 -230
  51. data/lib/google/cloud/vision/v1p3beta1/doc/google/protobuf/timestamp.rb +0 -109
  52. data/lib/google/cloud/vision/v1p3beta1/doc/google/protobuf/wrappers.rb +0 -90
  53. data/lib/google/cloud/vision/v1p3beta1/doc/google/rpc/status.rb +0 -84
  54. data/lib/google/cloud/vision/v1p3beta1/doc/google/type/color.rb +0 -156
  55. data/lib/google/cloud/vision/v1p3beta1/doc/google/type/latlng.rb +0 -65
  56. data/lib/google/cloud/vision/v1p3beta1/geometry_pb.rb +0 -43
  57. data/lib/google/cloud/vision/v1p3beta1/helpers.rb +0 -1154
  58. data/lib/google/cloud/vision/v1p3beta1/image_annotator_client.rb +0 -302
  59. data/lib/google/cloud/vision/v1p3beta1/image_annotator_client_config.json +0 -36
  60. data/lib/google/cloud/vision/v1p3beta1/image_annotator_pb.rb +0 -304
  61. data/lib/google/cloud/vision/v1p3beta1/image_annotator_services_pb.rb +0 -55
  62. data/lib/google/cloud/vision/v1p3beta1/product_search_client.rb +0 -1351
  63. data/lib/google/cloud/vision/v1p3beta1/product_search_client_config.json +0 -116
  64. data/lib/google/cloud/vision/v1p3beta1/product_search_pb.rb +0 -64
  65. data/lib/google/cloud/vision/v1p3beta1/product_search_service_pb.rb +0 -191
  66. data/lib/google/cloud/vision/v1p3beta1/product_search_service_services_pb.rb +0 -222
  67. data/lib/google/cloud/vision/v1p3beta1/text_annotation_pb.rb +0 -94
  68. data/lib/google/cloud/vision/v1p3beta1/web_detection_pb.rb +0 -51
  69. data/lib/google/cloud/vision/v1p3beta1.rb +0 -233
@@ -1,94 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/cloud/vision/v1p3beta1/text_annotation.proto
3
-
4
-
5
- require 'google/protobuf'
6
-
7
- require 'google/api/annotations_pb'
8
- require 'google/cloud/vision/v1p3beta1/geometry_pb'
9
- Google::Protobuf::DescriptorPool.generated_pool.build do
10
- add_message "google.cloud.vision.v1p3beta1.TextAnnotation" do
11
- repeated :pages, :message, 1, "google.cloud.vision.v1p3beta1.Page"
12
- optional :text, :string, 2
13
- end
14
- add_message "google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage" do
15
- optional :language_code, :string, 1
16
- optional :confidence, :float, 2
17
- end
18
- add_message "google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak" do
19
- optional :type, :enum, 1, "google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType"
20
- optional :is_prefix, :bool, 2
21
- end
22
- add_enum "google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType" do
23
- value :UNKNOWN, 0
24
- value :SPACE, 1
25
- value :SURE_SPACE, 2
26
- value :EOL_SURE_SPACE, 3
27
- value :HYPHEN, 4
28
- value :LINE_BREAK, 5
29
- end
30
- add_message "google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty" do
31
- repeated :detected_languages, :message, 1, "google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage"
32
- optional :detected_break, :message, 2, "google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak"
33
- end
34
- add_message "google.cloud.vision.v1p3beta1.Page" do
35
- optional :property, :message, 1, "google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty"
36
- optional :width, :int32, 2
37
- optional :height, :int32, 3
38
- repeated :blocks, :message, 4, "google.cloud.vision.v1p3beta1.Block"
39
- optional :confidence, :float, 5
40
- end
41
- add_message "google.cloud.vision.v1p3beta1.Block" do
42
- optional :property, :message, 1, "google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty"
43
- optional :bounding_box, :message, 2, "google.cloud.vision.v1p3beta1.BoundingPoly"
44
- repeated :paragraphs, :message, 3, "google.cloud.vision.v1p3beta1.Paragraph"
45
- optional :block_type, :enum, 4, "google.cloud.vision.v1p3beta1.Block.BlockType"
46
- optional :confidence, :float, 5
47
- end
48
- add_enum "google.cloud.vision.v1p3beta1.Block.BlockType" do
49
- value :UNKNOWN, 0
50
- value :TEXT, 1
51
- value :TABLE, 2
52
- value :PICTURE, 3
53
- value :RULER, 4
54
- value :BARCODE, 5
55
- end
56
- add_message "google.cloud.vision.v1p3beta1.Paragraph" do
57
- optional :property, :message, 1, "google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty"
58
- optional :bounding_box, :message, 2, "google.cloud.vision.v1p3beta1.BoundingPoly"
59
- repeated :words, :message, 3, "google.cloud.vision.v1p3beta1.Word"
60
- optional :confidence, :float, 4
61
- end
62
- add_message "google.cloud.vision.v1p3beta1.Word" do
63
- optional :property, :message, 1, "google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty"
64
- optional :bounding_box, :message, 2, "google.cloud.vision.v1p3beta1.BoundingPoly"
65
- repeated :symbols, :message, 3, "google.cloud.vision.v1p3beta1.Symbol"
66
- optional :confidence, :float, 4
67
- end
68
- add_message "google.cloud.vision.v1p3beta1.Symbol" do
69
- optional :property, :message, 1, "google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty"
70
- optional :bounding_box, :message, 2, "google.cloud.vision.v1p3beta1.BoundingPoly"
71
- optional :text, :string, 3
72
- optional :confidence, :float, 4
73
- end
74
- end
75
-
76
- module Google
77
- module Cloud
78
- module Vision
79
- module V1p3beta1
80
- TextAnnotation = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.TextAnnotation").msgclass
81
- TextAnnotation::DetectedLanguage = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage").msgclass
82
- TextAnnotation::DetectedBreak = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak").msgclass
83
- TextAnnotation::DetectedBreak::BreakType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType").enummodule
84
- TextAnnotation::TextProperty = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty").msgclass
85
- Page = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Page").msgclass
86
- Block = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Block").msgclass
87
- Block::BlockType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Block.BlockType").enummodule
88
- Paragraph = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Paragraph").msgclass
89
- Word = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Word").msgclass
90
- Symbol = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Symbol").msgclass
91
- end
92
- end
93
- end
94
- end
@@ -1,51 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/cloud/vision/v1p3beta1/web_detection.proto
3
-
4
-
5
- require 'google/protobuf'
6
-
7
- require 'google/api/annotations_pb'
8
- Google::Protobuf::DescriptorPool.generated_pool.build do
9
- add_message "google.cloud.vision.v1p3beta1.WebDetection" do
10
- repeated :web_entities, :message, 1, "google.cloud.vision.v1p3beta1.WebDetection.WebEntity"
11
- repeated :full_matching_images, :message, 2, "google.cloud.vision.v1p3beta1.WebDetection.WebImage"
12
- repeated :partial_matching_images, :message, 3, "google.cloud.vision.v1p3beta1.WebDetection.WebImage"
13
- repeated :pages_with_matching_images, :message, 4, "google.cloud.vision.v1p3beta1.WebDetection.WebPage"
14
- repeated :visually_similar_images, :message, 6, "google.cloud.vision.v1p3beta1.WebDetection.WebImage"
15
- repeated :best_guess_labels, :message, 8, "google.cloud.vision.v1p3beta1.WebDetection.WebLabel"
16
- end
17
- add_message "google.cloud.vision.v1p3beta1.WebDetection.WebEntity" do
18
- optional :entity_id, :string, 1
19
- optional :score, :float, 2
20
- optional :description, :string, 3
21
- end
22
- add_message "google.cloud.vision.v1p3beta1.WebDetection.WebImage" do
23
- optional :url, :string, 1
24
- optional :score, :float, 2
25
- end
26
- add_message "google.cloud.vision.v1p3beta1.WebDetection.WebPage" do
27
- optional :url, :string, 1
28
- optional :score, :float, 2
29
- optional :page_title, :string, 3
30
- repeated :full_matching_images, :message, 4, "google.cloud.vision.v1p3beta1.WebDetection.WebImage"
31
- repeated :partial_matching_images, :message, 5, "google.cloud.vision.v1p3beta1.WebDetection.WebImage"
32
- end
33
- add_message "google.cloud.vision.v1p3beta1.WebDetection.WebLabel" do
34
- optional :label, :string, 1
35
- optional :language_code, :string, 2
36
- end
37
- end
38
-
39
- module Google
40
- module Cloud
41
- module Vision
42
- module V1p3beta1
43
- WebDetection = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.WebDetection").msgclass
44
- WebDetection::WebEntity = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.WebDetection.WebEntity").msgclass
45
- WebDetection::WebImage = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.WebDetection.WebImage").msgclass
46
- WebDetection::WebPage = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.WebDetection.WebPage").msgclass
47
- WebDetection::WebLabel = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.WebDetection.WebLabel").msgclass
48
- end
49
- end
50
- end
51
- end
@@ -1,233 +0,0 @@
1
- # Copyright 2018 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
-
16
- require "google/cloud/vision/v1p3beta1/product_search_client"
17
- require "google/cloud/vision/v1p3beta1/image_annotator_client"
18
- require "google/cloud/vision/v1p3beta1/helpers"
19
- require "google/cloud/vision/v1p3beta1/image_annotator_pb"
20
- require "google/cloud/vision/v1p3beta1/product_search_service_pb"
21
-
22
- module Google
23
- module Cloud
24
- module Vision
25
- # rubocop:disable LineLength
26
-
27
- ##
28
- # # Ruby Client for Cloud Vision API ([Alpha](https://github.com/googleapis/google-cloud-ruby#versioning))
29
- #
30
- # [Cloud Vision API][Product Documentation]:
31
- # Integrates Google Vision features, including image labeling, face, logo, and
32
- # landmark detection, optical character recognition (OCR), and detection of
33
- # explicit content, into applications.
34
- # - [Product Documentation][]
35
- #
36
- # ## Quick Start
37
- # In order to use this library, you first need to go through the following
38
- # steps:
39
- #
40
- # 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
41
- # 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
42
- # 3. [Enable the Cloud Vision API.](https://console.cloud.google.com/apis/library/vision.googleapis.com)
43
- # 4. [Setup Authentication.](https://googleapis.github.io/google-cloud-ruby/#/docs/google-cloud/master/guides/authentication)
44
- #
45
- # ### Installation
46
- # ```
47
- # $ gem install google-cloud-vision
48
- # ```
49
- #
50
- # ### Preview
51
- # #### ImageAnnotatorClient
52
- # ```rb
53
- # require "google/cloud/vision"
54
- #
55
- # image_annotator_client = Google::Cloud::Vision::ImageAnnotator.new(version: :v1p3beta1)
56
- # gcs_image_uri = "gs://gapic-toolkit/President_Barack_Obama.jpg"
57
- # source = { gcs_image_uri: gcs_image_uri }
58
- # image = { source: source }
59
- # type = :FACE_DETECTION
60
- # features_element = { type: type }
61
- # features = [features_element]
62
- # requests_element = { image: image, features: features }
63
- # requests = [requests_element]
64
- # response = image_annotator_client.batch_annotate_images(requests)
65
- # ```
66
- #
67
- # ### Next Steps
68
- # - Read the [Cloud Vision API Product documentation][Product Documentation]
69
- # to learn more about the product and see How-to Guides.
70
- # - View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
71
- # to see the full list of Cloud APIs that we cover.
72
- #
73
- # [Product Documentation]: https://cloud.google.com/vision
74
- #
75
- # ## Enabling Logging
76
- #
77
- # To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
78
- # The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,
79
- # or a [`Google::Cloud::Logging::Logger`](https://googleapis.github.io/google-cloud-ruby/#/docs/google-cloud-logging/latest/google/cloud/logging/logger)
80
- # that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
81
- # and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
82
- #
83
- # Configuring a Ruby stdlib logger:
84
- #
85
- # ```ruby
86
- # require "logger"
87
- #
88
- # module MyLogger
89
- # LOGGER = Logger.new $stderr, level: Logger::WARN
90
- # def logger
91
- # LOGGER
92
- # end
93
- # end
94
- #
95
- # # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
96
- # module GRPC
97
- # extend MyLogger
98
- # end
99
- # ```
100
- #
101
- module V1p3beta1
102
- # rubocop:enable LineLength
103
-
104
- module ProductSearch
105
- ##
106
- # Manages Products and ProductSets of reference images for use in product
107
- # search. It uses the following resource model:
108
- #
109
- # * The API has a collection of {Google::Cloud::Vision::V1p3beta1::ProductSet ProductSet} resources, named
110
- # `projects/*/locations/*/productSets/*`, which acts as a way to put different
111
- # products into groups to limit identification.
112
- #
113
- # In parallel,
114
- #
115
- # * The API has a collection of {Google::Cloud::Vision::V1p3beta1::Product Product} resources, named
116
- # `projects/*/locations/*/products/*`
117
- #
118
- # * Each {Google::Cloud::Vision::V1p3beta1::Product Product} has a collection of {Google::Cloud::Vision::V1p3beta1::ReferenceImage ReferenceImage} resources, named
119
- # `projects/*/locations/*/products/*/referenceImages/*`
120
- #
121
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
122
- # Provides the means for authenticating requests made by the client. This parameter can
123
- # be many types.
124
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
125
- # authenticating requests made by this client.
126
- # A `String` will be treated as the path to the keyfile to be used for the construction of
127
- # credentials for this client.
128
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
129
- # credentials for this client.
130
- # A `GRPC::Core::Channel` will be used to make calls through.
131
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
132
- # should already be composed with a `GRPC::Core::CallCredentials` object.
133
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
134
- # metadata for requests, generally, to give OAuth credentials.
135
- # @param scopes [Array<String>]
136
- # The OAuth scopes for this service. This parameter is ignored if
137
- # an updater_proc is supplied.
138
- # @param client_config [Hash]
139
- # A Hash for call options for each method. See
140
- # Google::Gax#construct_settings for the structure of
141
- # this data. Falls back to the default config if not specified
142
- # or the specified config is missing data points.
143
- # @param timeout [Numeric]
144
- # The default timeout, in seconds, for calls made through this client.
145
- # @param metadata [Hash]
146
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
147
- # @param exception_transformer [Proc]
148
- # An optional proc that intercepts any exceptions raised during an API call to inject
149
- # custom error handling.
150
- def self.new \
151
- credentials: nil,
152
- scopes: nil,
153
- client_config: nil,
154
- timeout: nil,
155
- metadata: nil,
156
- exception_transformer: nil,
157
- lib_name: nil,
158
- lib_version: nil
159
- kwargs = {
160
- credentials: credentials,
161
- scopes: scopes,
162
- client_config: client_config,
163
- timeout: timeout,
164
- metadata: metadata,
165
- exception_transformer: exception_transformer,
166
- lib_name: lib_name,
167
- lib_version: lib_version
168
- }.select { |_, v| v != nil }
169
- Google::Cloud::Vision::V1p3beta1::ProductSearchClient.new(**kwargs)
170
- end
171
- end
172
-
173
- module ImageAnnotator
174
- ##
175
- # Service that performs Google Cloud Vision API detection tasks over client
176
- # images, such as face, landmark, logo, label, and text detection. The
177
- # ImageAnnotator service returns detected entities from the images.
178
- #
179
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
180
- # Provides the means for authenticating requests made by the client. This parameter can
181
- # be many types.
182
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
183
- # authenticating requests made by this client.
184
- # A `String` will be treated as the path to the keyfile to be used for the construction of
185
- # credentials for this client.
186
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
187
- # credentials for this client.
188
- # A `GRPC::Core::Channel` will be used to make calls through.
189
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
190
- # should already be composed with a `GRPC::Core::CallCredentials` object.
191
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
192
- # metadata for requests, generally, to give OAuth credentials.
193
- # @param scopes [Array<String>]
194
- # The OAuth scopes for this service. This parameter is ignored if
195
- # an updater_proc is supplied.
196
- # @param client_config [Hash]
197
- # A Hash for call options for each method. See
198
- # Google::Gax#construct_settings for the structure of
199
- # this data. Falls back to the default config if not specified
200
- # or the specified config is missing data points.
201
- # @param timeout [Numeric]
202
- # The default timeout, in seconds, for calls made through this client.
203
- # @param metadata [Hash]
204
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
205
- # @param exception_transformer [Proc]
206
- # An optional proc that intercepts any exceptions raised during an API call to inject
207
- # custom error handling.
208
- def self.new \
209
- credentials: nil,
210
- scopes: nil,
211
- client_config: nil,
212
- timeout: nil,
213
- metadata: nil,
214
- exception_transformer: nil,
215
- lib_name: nil,
216
- lib_version: nil
217
- kwargs = {
218
- credentials: credentials,
219
- scopes: scopes,
220
- client_config: client_config,
221
- timeout: timeout,
222
- metadata: metadata,
223
- exception_transformer: exception_transformer,
224
- lib_name: lib_name,
225
- lib_version: lib_version
226
- }.select { |_, v| v != nil }
227
- Google::Cloud::Vision::V1p3beta1::ImageAnnotatorClient.new(**kwargs)
228
- end
229
- end
230
- end
231
- end
232
- end
233
- end