Skip to content

Commit 9d34bdd

Browse files
yoshi-automationquartzmo
authored andcommitted
Update generated google-cloud-vision files (googleapis#3279)
* Add ImageAnnotatorClient#batch_annotate_files * Add AnnotateFileRequest * Add BatchAnnotateFilesRequest * Add BatchAnnotateFilesResponse * Add ImageAnnotatorClient#async_batch_annotate_images * Add AsyncBatchAnnotateImagesRequest * Add AsyncBatchAnnotateImagesResponse * Add AnnotateFileResponse#total_pages * Add InputConfig#content * Update documentation
1 parent 40b3c6c commit 9d34bdd

18 files changed

Lines changed: 1229 additions & 790 deletions

google-cloud-vision/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Ruby Client for Cloud Vision API ([Alpha](https://github.com/googleapis/google-cloud-ruby#versioning))
22

33
[Cloud Vision API][Product Documentation]:
4-
Integrates Google Vision features, including image labeling, face, logo, and
5-
landmark detection, optical character recognition (OCR), and detection of
6-
explicit content, into applications.
4+
Integrates Google Vision features, including image labeling, face, logo,
5+
and landmark detection, optical character recognition (OCR), and detection
6+
of explicit content, into applications.
77
- [Client Library Documentation][]
88
- [Product Documentation][]
99

google-cloud-vision/lib/google/cloud/vision.rb

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ module Cloud
2424
# # Ruby Client for Cloud Vision API ([Alpha](https://github.com/googleapis/google-cloud-ruby#versioning))
2525
#
2626
# [Cloud Vision API][Product Documentation]:
27-
# Integrates Google Vision features, including image labeling, face, logo, and
28-
# landmark detection, optical character recognition (OCR), and detection of
29-
# explicit content, into applications.
27+
# Integrates Google Vision features, including image labeling, face, logo,
28+
# and landmark detection, optical character recognition (OCR), and detection
29+
# of explicit content, into applications.
3030
# - [Product Documentation][]
3131
#
3232
# ## Quick Start
@@ -112,24 +112,11 @@ module Vision
112112
.select { |dir| File.exist?(dir + ".rb") }
113113
.map { |dir| File.basename(dir) }
114114

115-
module ProductSearch
115+
module ImageAnnotator
116116
##
117-
# Manages Products and ProductSets of reference images for use in product
118-
# search. It uses the following resource model:
119-
#
120-
# * The API has a collection of {Google::Cloud::Vision::V1::ProductSet ProductSet}
121-
# resources, named `projects/*/locations/*/productSets/*`, which acts as a way
122-
# to put different products into groups to limit identification.
123-
#
124-
# In parallel,
125-
#
126-
# * The API has a collection of {Google::Cloud::Vision::V1::Product Product}
127-
# resources, named
128-
# `projects/*/locations/*/products/*`
129-
#
130-
# * Each {Google::Cloud::Vision::V1::Product Product} has a collection of
131-
# {Google::Cloud::Vision::V1::ReferenceImage ReferenceImage} resources, named
132-
# `projects/*/locations/*/products/*/referenceImages/*`
117+
# Service that performs Google Cloud Vision API detection tasks over client
118+
# images, such as face, landmark, logo, label, and text detection. The
119+
# ImageAnnotator service returns detected entities from the images.
133120
#
134121
# @param version [Symbol, String]
135122
# The major version of the service to be used. By default :v1
@@ -175,15 +162,28 @@ def self.new(*args, version: :v1, **kwargs)
175162
.constants
176163
.select {|sym| sym.to_s.downcase == version.to_s.downcase}
177164
.first
178-
Google::Cloud::Vision.const_get(version_module)::ProductSearch.new(*args, **kwargs)
165+
Google::Cloud::Vision.const_get(version_module)::ImageAnnotator.new(*args, **kwargs)
179166
end
180167
end
181168

182-
module ImageAnnotator
169+
module ProductSearch
183170
##
184-
# Service that performs Google Cloud Vision API detection tasks over client
185-
# images, such as face, landmark, logo, label, and text detection. The
186-
# ImageAnnotator service returns detected entities from the images.
171+
# Manages Products and ProductSets of reference images for use in product
172+
# search. It uses the following resource model:
173+
#
174+
# * The API has a collection of {Google::Cloud::Vision::V1::ProductSet ProductSet}
175+
# resources, named `projects/*/locations/*/productSets/*`, which acts as a way
176+
# to put different products into groups to limit identification.
177+
#
178+
# In parallel,
179+
#
180+
# * The API has a collection of {Google::Cloud::Vision::V1::Product Product}
181+
# resources, named
182+
# `projects/*/locations/*/products/*`
183+
#
184+
# * Each {Google::Cloud::Vision::V1::Product Product} has a collection of
185+
# {Google::Cloud::Vision::V1::ReferenceImage ReferenceImage} resources, named
186+
# `projects/*/locations/*/products/*/referenceImages/*`
187187
#
188188
# @param version [Symbol, String]
189189
# The major version of the service to be used. By default :v1
@@ -229,7 +229,7 @@ def self.new(*args, version: :v1, **kwargs)
229229
.constants
230230
.select {|sym| sym.to_s.downcase == version.to_s.downcase}
231231
.first
232-
Google::Cloud::Vision.const_get(version_module)::ImageAnnotator.new(*args, **kwargs)
232+
Google::Cloud::Vision.const_get(version_module)::ProductSearch.new(*args, **kwargs)
233233
end
234234
end
235235
end

google-cloud-vision/lib/google/cloud/vision/v1.rb

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
# limitations under the License.
1414

1515

16-
require "google/cloud/vision/v1/product_search_client"
1716
require "google/cloud/vision/v1/image_annotator_client"
1817
require "google/cloud/vision/v1/helpers"
18+
require "google/cloud/vision/v1/product_search_client"
1919
require "google/cloud/vision/v1/product_search_service_pb"
2020
require "google/cloud/vision/v1/image_annotator_pb"
2121

@@ -28,9 +28,9 @@ module Vision
2828
# # Ruby Client for Cloud Vision API ([Alpha](https://github.com/googleapis/google-cloud-ruby#versioning))
2929
#
3030
# [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.
31+
# Integrates Google Vision features, including image labeling, face, logo,
32+
# and landmark detection, optical character recognition (OCR), and detection
33+
# of explicit content, into applications.
3434
# - [Product Documentation][]
3535
#
3636
# ## Quick Start
@@ -101,24 +101,11 @@ module Vision
101101
module V1
102102
# rubocop:enable LineLength
103103

104-
module ProductSearch
104+
module ImageAnnotator
105105
##
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::V1::ProductSet ProductSet}
110-
# resources, named `projects/*/locations/*/productSets/*`, which acts as a way
111-
# to put different products into groups to limit identification.
112-
#
113-
# In parallel,
114-
#
115-
# * The API has a collection of {Google::Cloud::Vision::V1::Product Product}
116-
# resources, named
117-
# `projects/*/locations/*/products/*`
118-
#
119-
# * Each {Google::Cloud::Vision::V1::Product Product} has a collection of
120-
# {Google::Cloud::Vision::V1::ReferenceImage ReferenceImage} resources, named
121-
# `projects/*/locations/*/products/*/referenceImages/*`
106+
# Service that performs Google Cloud Vision API detection tasks over client
107+
# images, such as face, landmark, logo, label, and text detection. The
108+
# ImageAnnotator service returns detected entities from the images.
122109
#
123110
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
124111
# Provides the means for authenticating requests made by the client. This parameter can
@@ -168,15 +155,28 @@ def self.new \
168155
lib_name: lib_name,
169156
lib_version: lib_version
170157
}.select { |_, v| v != nil }
171-
Google::Cloud::Vision::V1::ProductSearchClient.new(**kwargs)
158+
Google::Cloud::Vision::V1::ImageAnnotatorClient.new(**kwargs)
172159
end
173160
end
174161

175-
module ImageAnnotator
162+
module ProductSearch
176163
##
177-
# Service that performs Google Cloud Vision API detection tasks over client
178-
# images, such as face, landmark, logo, label, and text detection. The
179-
# ImageAnnotator service returns detected entities from the images.
164+
# Manages Products and ProductSets of reference images for use in product
165+
# search. It uses the following resource model:
166+
#
167+
# * The API has a collection of {Google::Cloud::Vision::V1::ProductSet ProductSet}
168+
# resources, named `projects/*/locations/*/productSets/*`, which acts as a way
169+
# to put different products into groups to limit identification.
170+
#
171+
# In parallel,
172+
#
173+
# * The API has a collection of {Google::Cloud::Vision::V1::Product Product}
174+
# resources, named
175+
# `projects/*/locations/*/products/*`
176+
#
177+
# * Each {Google::Cloud::Vision::V1::Product Product} has a collection of
178+
# {Google::Cloud::Vision::V1::ReferenceImage ReferenceImage} resources, named
179+
# `projects/*/locations/*/products/*/referenceImages/*`
180180
#
181181
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
182182
# Provides the means for authenticating requests made by the client. This parameter can
@@ -226,7 +226,7 @@ def self.new \
226226
lib_name: lib_name,
227227
lib_version: lib_version
228228
}.select { |_, v| v != nil }
229-
Google::Cloud::Vision::V1::ImageAnnotatorClient.new(**kwargs)
229+
Google::Cloud::Vision::V1::ProductSearchClient.new(**kwargs)
230230
end
231231
end
232232
end

google-cloud-vision/lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/image_annotator.rb

Lines changed: 85 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class Image; end
128128
# @!attribute [rw] bounding_poly
129129
# @return [Google::Cloud::Vision::V1::BoundingPoly]
130130
# The bounding polygon around the face. The coordinates of the bounding box
131-
# are in the original image's scale, as returned in `ImageParams`.
131+
# are in the original image's scale.
132132
# The bounding box is computed to "frame" the face in accordance with human
133133
# expectations. It is based on the landmarker results.
134134
# Note that one or more x and/or y coordinates may not be generated in the
@@ -459,7 +459,7 @@ class ImageProperties; end
459459
# @!attribute [rw] bounding_poly
460460
# @return [Google::Cloud::Vision::V1::BoundingPoly]
461461
# The bounding polygon for the crop region. The coordinates of the bounding
462-
# box are in the original image's scale, as returned in `ImageParams`.
462+
# box are in the original image's scale.
463463
# @!attribute [rw] confidence
464464
# @return [Float]
465465
# Confidence of this being a salient region. Range [0, 1].
@@ -518,7 +518,7 @@ class WebDetectionParams; end
518518
class ImageContext; end
519519

520520
# Request for performing Google Cloud Vision API tasks over a user-provided
521-
# image, with user-requested features.
521+
# image, with user-requested features, and with context information.
522522
# @!attribute [rw] image
523523
# @return [Google::Cloud::Vision::V1::Image]
524524
# The image to be processed.
@@ -601,6 +601,9 @@ class AnnotateImageResponse; end
601601
# @!attribute [rw] responses
602602
# @return [Array<Google::Cloud::Vision::V1::AnnotateImageResponse>]
603603
# Individual responses to images found within the file.
604+
# @!attribute [rw] total_pages
605+
# @return [Integer]
606+
# This field gives the total number of pages in the file.
604607
class AnnotateFileResponse; end
605608

606609
# Multiple image annotation requests are batched into a single service call.
@@ -615,6 +618,48 @@ class BatchAnnotateImagesRequest; end
615618
# Individual responses to image annotation requests within the batch.
616619
class BatchAnnotateImagesResponse; end
617620

621+
# A request to annotate one single file, e.g. a PDF, TIFF or GIF file.
622+
# @!attribute [rw] input_config
623+
# @return [Google::Cloud::Vision::V1::InputConfig]
624+
# Required. Information about the input file.
625+
# @!attribute [rw] features
626+
# @return [Array<Google::Cloud::Vision::V1::Feature>]
627+
# Required. Requested features.
628+
# @!attribute [rw] image_context
629+
# @return [Google::Cloud::Vision::V1::ImageContext]
630+
# Additional context that may accompany the image(s) in the file.
631+
# @!attribute [rw] pages
632+
# @return [Array<Integer>]
633+
# Pages of the file to perform image annotation.
634+
#
635+
# Pages starts from 1, we assume the first page of the file is page 1.
636+
# At most 5 pages are supported per request. Pages can be negative.
637+
#
638+
# Page 1 means the first page.
639+
# Page 2 means the second page.
640+
# Page -1 means the last page.
641+
# Page -2 means the second to the last page.
642+
#
643+
# If the file is GIF instead of PDF or TIFF, page refers to GIF frames.
644+
#
645+
# If this field is empty, by default the service performs image annotation
646+
# for the first 5 pages of the file.
647+
class AnnotateFileRequest; end
648+
649+
# A list of requests to annotate files using the BatchAnnotateFiles API.
650+
# @!attribute [rw] requests
651+
# @return [Array<Google::Cloud::Vision::V1::AnnotateFileRequest>]
652+
# The list of file annotation requests. Right now we support only one
653+
# AnnotateFileRequest in BatchAnnotateFilesRequest.
654+
class BatchAnnotateFilesRequest; end
655+
656+
# A list of file annotation responses.
657+
# @!attribute [rw] responses
658+
# @return [Array<Google::Cloud::Vision::V1::AnnotateFileResponse>]
659+
# The list of file annotation responses, each response corresponding to each
660+
# AnnotateFileRequest in BatchAnnotateFilesRequest.
661+
class BatchAnnotateFilesResponse; end
662+
618663
# An offline file annotation request.
619664
# @!attribute [rw] input_config
620665
# @return [Google::Cloud::Vision::V1::InputConfig]
@@ -636,6 +681,21 @@ class AsyncAnnotateFileRequest; end
636681
# The output location and metadata from AsyncAnnotateFileRequest.
637682
class AsyncAnnotateFileResponse; end
638683

684+
# Request for async image annotation for a list of images.
685+
# @!attribute [rw] requests
686+
# @return [Array<Google::Cloud::Vision::V1::AnnotateImageRequest>]
687+
# Individual image annotation requests for this batch.
688+
# @!attribute [rw] output_config
689+
# @return [Google::Cloud::Vision::V1::OutputConfig]
690+
# Required. The desired output location and metadata (e.g. format).
691+
class AsyncBatchAnnotateImagesRequest; end
692+
693+
# Response to an async batch image annotation request.
694+
# @!attribute [rw] output_config
695+
# @return [Google::Cloud::Vision::V1::OutputConfig]
696+
# The output location and metadata from AsyncBatchAnnotateImagesRequest.
697+
class AsyncBatchAnnotateImagesResponse; end
698+
639699
# Multiple async file annotation requests are batched into a single service
640700
# call.
641701
# @!attribute [rw] requests
@@ -654,6 +714,14 @@ class AsyncBatchAnnotateFilesResponse; end
654714
# @!attribute [rw] gcs_source
655715
# @return [Google::Cloud::Vision::V1::GcsSource]
656716
# The Google Cloud Storage location to read the input from.
717+
# @!attribute [rw] content
718+
# @return [String]
719+
# File content, represented as a stream of bytes.
720+
# Note: As with all `bytes` fields, protobuffers use a pure binary
721+
# representation, whereas JSON representations use base64.
722+
#
723+
# Currently, this field only works for BatchAnnotateFiles requests. It does
724+
# not work for AsyncBatchAnnotateFiles requests.
657725
# @!attribute [rw] mime_type
658726
# @return [String]
659727
# The type of the file. Currently only "application/pdf" and "image/tiff"
@@ -689,16 +757,23 @@ class GcsSource; end
689757
# The Google Cloud Storage location where the output will be written to.
690758
# @!attribute [rw] uri
691759
# @return [String]
692-
# Google Cloud Storage URI where the results will be stored. Results will
693-
# be in JSON format and preceded by its corresponding input URI. This field
694-
# can either represent a single file, or a prefix for multiple outputs.
695-
# Prefixes must end in a `/`.
760+
# Google Cloud Storage URI prefix where the results will be stored. Results
761+
# will be in JSON format and preceded by its corresponding input URI prefix.
762+
# This field can either represent a gcs file prefix or gcs directory. In
763+
# either case, the uri should be unique because in order to get all of the
764+
# output files, you will need to do a wildcard gcs search on the uri prefix
765+
# you provide.
696766
#
697767
# Examples:
698768
#
699-
# * File: gs://bucket-name/filename.json
700-
# * Prefix: gs://bucket-name/prefix/here/
701-
# * File: gs://bucket-name/prefix/here
769+
# * File Prefix: gs://bucket-name/here/filenameprefix The output files
770+
# will be created in gs://bucket-name/here/ and the names of the
771+
# output files will begin with "filenameprefix".
772+
#
773+
# * Directory Prefix: gs://bucket-name/some/location/ The output files
774+
# will be created in gs://bucket-name/some/location/ and the names of the
775+
# output files could be anything because there was no filename prefix
776+
# specified.
702777
#
703778
# If multiple outputs, each response is still AnnotateFileResponse, each of
704779
# which contains some subset of the full list of AnnotateImageResponse.

google-cloud-vision/lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/product_search.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,20 @@ module V1
3838
# @return [String]
3939
# The filtering expression. This can be used to restrict search results based
4040
# on Product labels. We currently support an AND of OR of key-value
41-
# expressions, where each expression within an OR must have the same key.
41+
# expressions, where each expression within an OR must have the same key. An
42+
# '=' should be used to connect the key and value.
4243
#
4344
# For example, "(color = red OR color = blue) AND brand = Google" is
44-
# acceptable, but not "(color = red OR brand = Google)" or "color: red".
45+
# acceptable, but "(color = red OR brand = Google)" is not acceptable.
46+
# "color: red" is not acceptable because it uses a ':' instead of an '='.
4547
class ProductSearchParams; end
4648

4749
# Results for a product search request.
4850
# @!attribute [rw] index_time
4951
# @return [Google::Protobuf::Timestamp]
50-
# Timestamp of the index which provided these results. Changes made after
51-
# this time are not reflected in the current results.
52+
# Timestamp of the index which provided these results. Products added to the
53+
# product set and products removed from the product set after this time are
54+
# not reflected in the current results.
5255
# @!attribute [rw] results
5356
# @return [Array<Google::Cloud::Vision::V1::ProductSearchResults::Result>]
5457
# List of results, one for each product match.

google-cloud-vision/lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/product_search_service.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ class KeyValue; end
8383
# @return [Google::Protobuf::Timestamp]
8484
# Output only. The time at which this ProductSet was last indexed. Query
8585
# results will reflect all updates before this time. If this ProductSet has
86-
# never been indexed, this field is 0.
86+
# never been indexed, this timestamp is the default value
87+
# "1970-01-01T00:00:00Z".
8788
#
8889
# This field is ignored when creating a ProductSet.
8990
# @!attribute [rw] index_error

0 commit comments

Comments
 (0)