google-cloud-vision 0.31.0 → 0.32.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +2 -9
- data/LICENSE +1 -1
- data/README.md +94 -0
- data/lib/google/cloud/vision.rb +200 -535
- data/lib/google/cloud/vision/v1.rb +129 -55
- data/lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/image_annotator.rb +9 -0
- data/lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/product_search.rb +88 -0
- data/lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/product_search_service.rb +539 -0
- data/lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/text_annotation.rb +3 -3
- data/lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/web_detection.rb +2 -1
- data/lib/google/cloud/vision/{version.rb → v1/doc/google/protobuf/empty.rb} +13 -6
- data/lib/google/cloud/vision/v1/doc/google/protobuf/field_mask.rb +230 -0
- data/lib/google/cloud/vision/v1/doc/google/protobuf/timestamp.rb +109 -0
- data/lib/google/cloud/vision/v1/geometry_pb.rb +1 -0
- data/lib/google/cloud/vision/v1/helpers.rb +972 -0
- data/lib/google/cloud/vision/v1/image_annotator_client.rb +4 -4
- data/lib/google/cloud/vision/v1/image_annotator_pb.rb +5 -0
- data/lib/google/cloud/vision/v1/image_annotator_services_pb.rb +2 -1
- data/lib/google/cloud/vision/v1/product_search_client.rb +1337 -0
- data/lib/google/cloud/vision/v1/product_search_client_config.json +116 -0
- data/lib/google/cloud/vision/v1/product_search_pb.rb +45 -0
- data/lib/google/cloud/vision/v1/product_search_service_pb.rb +191 -0
- data/lib/google/cloud/vision/v1/product_search_service_services_pb.rb +224 -0
- data/lib/google/cloud/vision/v1p3beta1.rb +233 -0
- data/lib/google/cloud/vision/v1p3beta1/credentials.rb +42 -0
- data/lib/google/cloud/vision/v1p3beta1/doc/google/cloud/vision/v1p3beta1/geometry.rb +72 -0
- data/lib/google/cloud/vision/v1p3beta1/doc/google/cloud/vision/v1p3beta1/image_annotator.rb +763 -0
- data/lib/google/cloud/vision/v1p3beta1/doc/google/cloud/vision/v1p3beta1/product_search.rb +154 -0
- data/lib/google/cloud/vision/v1p3beta1/doc/google/cloud/vision/v1p3beta1/product_search_service.rb +533 -0
- data/lib/google/cloud/vision/v1p3beta1/doc/google/cloud/vision/v1p3beta1/text_annotation.rb +254 -0
- data/lib/google/cloud/vision/v1p3beta1/doc/google/cloud/vision/v1p3beta1/web_detection.rb +101 -0
- data/lib/google/cloud/vision/v1p3beta1/doc/google/longrunning/operations.rb +93 -0
- data/lib/google/cloud/vision/v1p3beta1/doc/google/protobuf/any.rb +130 -0
- data/lib/google/cloud/vision/v1p3beta1/doc/google/protobuf/empty.rb +29 -0
- data/lib/google/cloud/vision/v1p3beta1/doc/google/protobuf/field_mask.rb +230 -0
- data/lib/google/cloud/vision/v1p3beta1/doc/google/protobuf/timestamp.rb +109 -0
- data/lib/google/cloud/vision/v1p3beta1/doc/google/protobuf/wrappers.rb +90 -0
- data/lib/google/cloud/vision/v1p3beta1/doc/google/rpc/status.rb +84 -0
- data/lib/google/cloud/vision/v1p3beta1/doc/google/type/color.rb +156 -0
- data/lib/google/cloud/vision/v1p3beta1/doc/google/type/latlng.rb +65 -0
- data/lib/google/cloud/vision/v1p3beta1/geometry_pb.rb +43 -0
- data/lib/google/cloud/vision/v1p3beta1/helpers.rb +972 -0
- data/lib/google/cloud/vision/v1p3beta1/image_annotator_client.rb +302 -0
- data/lib/google/cloud/vision/v1p3beta1/image_annotator_client_config.json +36 -0
- data/lib/google/cloud/vision/v1p3beta1/image_annotator_pb.rb +304 -0
- data/lib/google/cloud/vision/v1p3beta1/image_annotator_services_pb.rb +55 -0
- data/lib/google/cloud/vision/v1p3beta1/product_search_client.rb +1351 -0
- data/lib/google/cloud/vision/v1p3beta1/product_search_client_config.json +116 -0
- data/lib/google/cloud/vision/v1p3beta1/product_search_pb.rb +64 -0
- data/lib/google/cloud/vision/v1p3beta1/product_search_service_pb.rb +191 -0
- data/lib/google/cloud/vision/v1p3beta1/product_search_service_services_pb.rb +222 -0
- data/lib/google/cloud/vision/v1p3beta1/text_annotation_pb.rb +94 -0
- data/lib/google/cloud/vision/v1p3beta1/web_detection_pb.rb +51 -0
- metadata +53 -122
- data/AUTHENTICATION.md +0 -179
- data/CHANGELOG.md +0 -109
- data/CODE_OF_CONDUCT.md +0 -40
- data/CONTRIBUTING.md +0 -188
- data/LOGGING.md +0 -32
- data/OVERVIEW.md +0 -202
- data/TROUBLESHOOTING.md +0 -37
- data/lib/google-cloud-vision.rb +0 -146
- data/lib/google/cloud/vision/annotate.rb +0 -303
- data/lib/google/cloud/vision/annotation.rb +0 -553
- data/lib/google/cloud/vision/annotation/crop_hint.rb +0 -126
- data/lib/google/cloud/vision/annotation/entity.rb +0 -225
- data/lib/google/cloud/vision/annotation/face.rb +0 -1497
- data/lib/google/cloud/vision/annotation/normalized_vertex.rb +0 -76
- data/lib/google/cloud/vision/annotation/object_localization.rb +0 -115
- data/lib/google/cloud/vision/annotation/properties.rb +0 -220
- data/lib/google/cloud/vision/annotation/safe_search.rb +0 -153
- data/lib/google/cloud/vision/annotation/text.rb +0 -1015
- data/lib/google/cloud/vision/annotation/vertex.rb +0 -91
- data/lib/google/cloud/vision/annotation/web.rb +0 -420
- data/lib/google/cloud/vision/credentials.rb +0 -57
- data/lib/google/cloud/vision/image.rb +0 -832
- data/lib/google/cloud/vision/location.rb +0 -98
- data/lib/google/cloud/vision/project.rb +0 -367
- data/lib/google/cloud/vision/service.rb +0 -83
@@ -0,0 +1,254 @@
|
|
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
|
+
module Google
|
17
|
+
module Cloud
|
18
|
+
module Vision
|
19
|
+
module V1p3beta1
|
20
|
+
# TextAnnotation contains a structured representation of OCR extracted text.
|
21
|
+
# The hierarchy of an OCR extracted text structure is like this:
|
22
|
+
# TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol
|
23
|
+
# Each structural component, starting from Page, may further have their own
|
24
|
+
# properties. Properties describe detected languages, breaks etc.. Please refer
|
25
|
+
# to the {Google::Cloud::Vision::V1p3beta1::TextAnnotation::TextProperty TextAnnotation::TextProperty} message definition below for more
|
26
|
+
# detail.
|
27
|
+
# @!attribute [rw] pages
|
28
|
+
# @return [Array<Google::Cloud::Vision::V1p3beta1::Page>]
|
29
|
+
# List of pages detected by OCR.
|
30
|
+
# @!attribute [rw] text
|
31
|
+
# @return [String]
|
32
|
+
# UTF-8 text detected on the pages.
|
33
|
+
class TextAnnotation
|
34
|
+
# Detected language for a structural component.
|
35
|
+
# @!attribute [rw] language_code
|
36
|
+
# @return [String]
|
37
|
+
# The BCP-47 language code, such as "en-US" or "sr-Latn". For more
|
38
|
+
# information, see
|
39
|
+
# http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
|
40
|
+
# @!attribute [rw] confidence
|
41
|
+
# @return [Float]
|
42
|
+
# Confidence of detected language. Range [0, 1].
|
43
|
+
class DetectedLanguage; end
|
44
|
+
|
45
|
+
# Detected start or end of a structural component.
|
46
|
+
# @!attribute [rw] type
|
47
|
+
# @return [Google::Cloud::Vision::V1p3beta1::TextAnnotation::DetectedBreak::BreakType]
|
48
|
+
# Detected break type.
|
49
|
+
# @!attribute [rw] is_prefix
|
50
|
+
# @return [true, false]
|
51
|
+
# True if break prepends the element.
|
52
|
+
class DetectedBreak
|
53
|
+
# Enum to denote the type of break found. New line, space etc.
|
54
|
+
module BreakType
|
55
|
+
# Unknown break label type.
|
56
|
+
UNKNOWN = 0
|
57
|
+
|
58
|
+
# Regular space.
|
59
|
+
SPACE = 1
|
60
|
+
|
61
|
+
# Sure space (very wide).
|
62
|
+
SURE_SPACE = 2
|
63
|
+
|
64
|
+
# Line-wrapping break.
|
65
|
+
EOL_SURE_SPACE = 3
|
66
|
+
|
67
|
+
# End-line hyphen that is not present in text; does not co-occur with
|
68
|
+
# `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`.
|
69
|
+
HYPHEN = 4
|
70
|
+
|
71
|
+
# Line break that ends a paragraph.
|
72
|
+
LINE_BREAK = 5
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
# Additional information detected on the structural component.
|
77
|
+
# @!attribute [rw] detected_languages
|
78
|
+
# @return [Array<Google::Cloud::Vision::V1p3beta1::TextAnnotation::DetectedLanguage>]
|
79
|
+
# A list of detected languages together with confidence.
|
80
|
+
# @!attribute [rw] detected_break
|
81
|
+
# @return [Google::Cloud::Vision::V1p3beta1::TextAnnotation::DetectedBreak]
|
82
|
+
# Detected start or end of a text segment.
|
83
|
+
class TextProperty; end
|
84
|
+
end
|
85
|
+
|
86
|
+
# Detected page from OCR.
|
87
|
+
# @!attribute [rw] property
|
88
|
+
# @return [Google::Cloud::Vision::V1p3beta1::TextAnnotation::TextProperty]
|
89
|
+
# Additional information detected on the page.
|
90
|
+
# @!attribute [rw] width
|
91
|
+
# @return [Integer]
|
92
|
+
# Page width. For PDFs the unit is points. For images (including
|
93
|
+
# TIFFs) the unit is pixels.
|
94
|
+
# @!attribute [rw] height
|
95
|
+
# @return [Integer]
|
96
|
+
# Page height. For PDFs the unit is points. For images (including
|
97
|
+
# TIFFs) the unit is pixels.
|
98
|
+
# @!attribute [rw] blocks
|
99
|
+
# @return [Array<Google::Cloud::Vision::V1p3beta1::Block>]
|
100
|
+
# List of blocks of text, images etc on this page.
|
101
|
+
# @!attribute [rw] confidence
|
102
|
+
# @return [Float]
|
103
|
+
# Confidence of the OCR results on the page. Range [0, 1].
|
104
|
+
class Page; end
|
105
|
+
|
106
|
+
# Logical element on the page.
|
107
|
+
# @!attribute [rw] property
|
108
|
+
# @return [Google::Cloud::Vision::V1p3beta1::TextAnnotation::TextProperty]
|
109
|
+
# Additional information detected for the block.
|
110
|
+
# @!attribute [rw] bounding_box
|
111
|
+
# @return [Google::Cloud::Vision::V1p3beta1::BoundingPoly]
|
112
|
+
# The bounding box for the block.
|
113
|
+
# The vertices are in the order of top-left, top-right, bottom-right,
|
114
|
+
# bottom-left. When a rotation of the bounding box is detected the rotation
|
115
|
+
# is represented as around the top-left corner as defined when the text is
|
116
|
+
# read in the 'natural' orientation.
|
117
|
+
# For example:
|
118
|
+
#
|
119
|
+
# * when the text is horizontal it might look like:
|
120
|
+
#
|
121
|
+
# 0----1
|
122
|
+
# | |
|
123
|
+
# 3----2
|
124
|
+
#
|
125
|
+
# * when it's rotated 180 degrees around the top-left corner it becomes:
|
126
|
+
#
|
127
|
+
# 2----3
|
128
|
+
# | |
|
129
|
+
# 1----0
|
130
|
+
#
|
131
|
+
# and the vertice order will still be (0, 1, 2, 3).
|
132
|
+
# @!attribute [rw] paragraphs
|
133
|
+
# @return [Array<Google::Cloud::Vision::V1p3beta1::Paragraph>]
|
134
|
+
# List of paragraphs in this block (if this blocks is of type text).
|
135
|
+
# @!attribute [rw] block_type
|
136
|
+
# @return [Google::Cloud::Vision::V1p3beta1::Block::BlockType]
|
137
|
+
# Detected block type (text, image etc) for this block.
|
138
|
+
# @!attribute [rw] confidence
|
139
|
+
# @return [Float]
|
140
|
+
# Confidence of the OCR results on the block. Range [0, 1].
|
141
|
+
class Block
|
142
|
+
# Type of a block (text, image etc) as identified by OCR.
|
143
|
+
module BlockType
|
144
|
+
# Unknown block type.
|
145
|
+
UNKNOWN = 0
|
146
|
+
|
147
|
+
# Regular text block.
|
148
|
+
TEXT = 1
|
149
|
+
|
150
|
+
# Table block.
|
151
|
+
TABLE = 2
|
152
|
+
|
153
|
+
# Image block.
|
154
|
+
PICTURE = 3
|
155
|
+
|
156
|
+
# Horizontal/vertical line box.
|
157
|
+
RULER = 4
|
158
|
+
|
159
|
+
# Barcode block.
|
160
|
+
BARCODE = 5
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
# Structural unit of text representing a number of words in certain order.
|
165
|
+
# @!attribute [rw] property
|
166
|
+
# @return [Google::Cloud::Vision::V1p3beta1::TextAnnotation::TextProperty]
|
167
|
+
# Additional information detected for the paragraph.
|
168
|
+
# @!attribute [rw] bounding_box
|
169
|
+
# @return [Google::Cloud::Vision::V1p3beta1::BoundingPoly]
|
170
|
+
# The bounding box for the paragraph.
|
171
|
+
# The vertices are in the order of top-left, top-right, bottom-right,
|
172
|
+
# bottom-left. When a rotation of the bounding box is detected the rotation
|
173
|
+
# is represented as around the top-left corner as defined when the text is
|
174
|
+
# read in the 'natural' orientation.
|
175
|
+
# For example:
|
176
|
+
# * when the text is horizontal it might look like:
|
177
|
+
# 0----1
|
178
|
+
# | |
|
179
|
+
# 3----2
|
180
|
+
# * when it's rotated 180 degrees around the top-left corner it becomes:
|
181
|
+
# 2----3
|
182
|
+
# | |
|
183
|
+
# 1----0
|
184
|
+
# and the vertice order will still be (0, 1, 2, 3).
|
185
|
+
# @!attribute [rw] words
|
186
|
+
# @return [Array<Google::Cloud::Vision::V1p3beta1::Word>]
|
187
|
+
# List of words in this paragraph.
|
188
|
+
# @!attribute [rw] confidence
|
189
|
+
# @return [Float]
|
190
|
+
# Confidence of the OCR results for the paragraph. Range [0, 1].
|
191
|
+
class Paragraph; end
|
192
|
+
|
193
|
+
# A word representation.
|
194
|
+
# @!attribute [rw] property
|
195
|
+
# @return [Google::Cloud::Vision::V1p3beta1::TextAnnotation::TextProperty]
|
196
|
+
# Additional information detected for the word.
|
197
|
+
# @!attribute [rw] bounding_box
|
198
|
+
# @return [Google::Cloud::Vision::V1p3beta1::BoundingPoly]
|
199
|
+
# The bounding box for the word.
|
200
|
+
# The vertices are in the order of top-left, top-right, bottom-right,
|
201
|
+
# bottom-left. When a rotation of the bounding box is detected the rotation
|
202
|
+
# is represented as around the top-left corner as defined when the text is
|
203
|
+
# read in the 'natural' orientation.
|
204
|
+
# For example:
|
205
|
+
# * when the text is horizontal it might look like:
|
206
|
+
# 0----1
|
207
|
+
# | |
|
208
|
+
# 3----2
|
209
|
+
# * when it's rotated 180 degrees around the top-left corner it becomes:
|
210
|
+
# 2----3
|
211
|
+
# | |
|
212
|
+
# 1----0
|
213
|
+
# and the vertice order will still be (0, 1, 2, 3).
|
214
|
+
# @!attribute [rw] symbols
|
215
|
+
# @return [Array<Google::Cloud::Vision::V1p3beta1::Symbol>]
|
216
|
+
# List of symbols in the word.
|
217
|
+
# The order of the symbols follows the natural reading order.
|
218
|
+
# @!attribute [rw] confidence
|
219
|
+
# @return [Float]
|
220
|
+
# Confidence of the OCR results for the word. Range [0, 1].
|
221
|
+
class Word; end
|
222
|
+
|
223
|
+
# A single symbol representation.
|
224
|
+
# @!attribute [rw] property
|
225
|
+
# @return [Google::Cloud::Vision::V1p3beta1::TextAnnotation::TextProperty]
|
226
|
+
# Additional information detected for the symbol.
|
227
|
+
# @!attribute [rw] bounding_box
|
228
|
+
# @return [Google::Cloud::Vision::V1p3beta1::BoundingPoly]
|
229
|
+
# The bounding box for the symbol.
|
230
|
+
# The vertices are in the order of top-left, top-right, bottom-right,
|
231
|
+
# bottom-left. When a rotation of the bounding box is detected the rotation
|
232
|
+
# is represented as around the top-left corner as defined when the text is
|
233
|
+
# read in the 'natural' orientation.
|
234
|
+
# For example:
|
235
|
+
# * when the text is horizontal it might look like:
|
236
|
+
# 0----1
|
237
|
+
# | |
|
238
|
+
# 3----2
|
239
|
+
# * when it's rotated 180 degrees around the top-left corner it becomes:
|
240
|
+
# 2----3
|
241
|
+
# | |
|
242
|
+
# 1----0
|
243
|
+
# and the vertice order will still be (0, 1, 2, 3).
|
244
|
+
# @!attribute [rw] text
|
245
|
+
# @return [String]
|
246
|
+
# The actual UTF-8 representation of the symbol.
|
247
|
+
# @!attribute [rw] confidence
|
248
|
+
# @return [Float]
|
249
|
+
# Confidence of the OCR results for the symbol. Range [0, 1].
|
250
|
+
class Symbol; end
|
251
|
+
end
|
252
|
+
end
|
253
|
+
end
|
254
|
+
end
|
@@ -0,0 +1,101 @@
|
|
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
|
+
module Google
|
17
|
+
module Cloud
|
18
|
+
module Vision
|
19
|
+
module V1p3beta1
|
20
|
+
# Relevant information for the image from the Internet.
|
21
|
+
# @!attribute [rw] web_entities
|
22
|
+
# @return [Array<Google::Cloud::Vision::V1p3beta1::WebDetection::WebEntity>]
|
23
|
+
# Deduced entities from similar images on the Internet.
|
24
|
+
# @!attribute [rw] full_matching_images
|
25
|
+
# @return [Array<Google::Cloud::Vision::V1p3beta1::WebDetection::WebImage>]
|
26
|
+
# Fully matching images from the Internet.
|
27
|
+
# Can include resized copies of the query image.
|
28
|
+
# @!attribute [rw] partial_matching_images
|
29
|
+
# @return [Array<Google::Cloud::Vision::V1p3beta1::WebDetection::WebImage>]
|
30
|
+
# Partial matching images from the Internet.
|
31
|
+
# Those images are similar enough to share some key-point features. For
|
32
|
+
# example an original image will likely have partial matching for its crops.
|
33
|
+
# @!attribute [rw] pages_with_matching_images
|
34
|
+
# @return [Array<Google::Cloud::Vision::V1p3beta1::WebDetection::WebPage>]
|
35
|
+
# Web pages containing the matching images from the Internet.
|
36
|
+
# @!attribute [rw] visually_similar_images
|
37
|
+
# @return [Array<Google::Cloud::Vision::V1p3beta1::WebDetection::WebImage>]
|
38
|
+
# The visually similar image results.
|
39
|
+
# @!attribute [rw] best_guess_labels
|
40
|
+
# @return [Array<Google::Cloud::Vision::V1p3beta1::WebDetection::WebLabel>]
|
41
|
+
# Best guess text labels for the request image.
|
42
|
+
class WebDetection
|
43
|
+
# Entity deduced from similar images on the Internet.
|
44
|
+
# @!attribute [rw] entity_id
|
45
|
+
# @return [String]
|
46
|
+
# Opaque entity ID.
|
47
|
+
# @!attribute [rw] score
|
48
|
+
# @return [Float]
|
49
|
+
# Overall relevancy score for the entity.
|
50
|
+
# Not normalized and not comparable across different image queries.
|
51
|
+
# @!attribute [rw] description
|
52
|
+
# @return [String]
|
53
|
+
# Canonical description of the entity, in English.
|
54
|
+
class WebEntity; end
|
55
|
+
|
56
|
+
# Metadata for online images.
|
57
|
+
# @!attribute [rw] url
|
58
|
+
# @return [String]
|
59
|
+
# The result image URL.
|
60
|
+
# @!attribute [rw] score
|
61
|
+
# @return [Float]
|
62
|
+
# (Deprecated) Overall relevancy score for the image.
|
63
|
+
class WebImage; end
|
64
|
+
|
65
|
+
# Metadata for web pages.
|
66
|
+
# @!attribute [rw] url
|
67
|
+
# @return [String]
|
68
|
+
# The result web page URL.
|
69
|
+
# @!attribute [rw] score
|
70
|
+
# @return [Float]
|
71
|
+
# (Deprecated) Overall relevancy score for the web page.
|
72
|
+
# @!attribute [rw] page_title
|
73
|
+
# @return [String]
|
74
|
+
# Title for the web page, may contain HTML markups.
|
75
|
+
# @!attribute [rw] full_matching_images
|
76
|
+
# @return [Array<Google::Cloud::Vision::V1p3beta1::WebDetection::WebImage>]
|
77
|
+
# Fully matching images on the page.
|
78
|
+
# Can include resized copies of the query image.
|
79
|
+
# @!attribute [rw] partial_matching_images
|
80
|
+
# @return [Array<Google::Cloud::Vision::V1p3beta1::WebDetection::WebImage>]
|
81
|
+
# Partial matching images on the page.
|
82
|
+
# Those images are similar enough to share some key-point features. For
|
83
|
+
# example an original image will likely have partial matching for its
|
84
|
+
# crops.
|
85
|
+
class WebPage; end
|
86
|
+
|
87
|
+
# Label to provide extra metadata for the web detection.
|
88
|
+
# @!attribute [rw] label
|
89
|
+
# @return [String]
|
90
|
+
# Label for extra metadata.
|
91
|
+
# @!attribute [rw] language_code
|
92
|
+
# @return [String]
|
93
|
+
# The BCP-47 language code for `label`, such as "en-US" or "sr-Latn".
|
94
|
+
# For more information, see
|
95
|
+
# http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
|
96
|
+
class WebLabel; end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
@@ -0,0 +1,93 @@
|
|
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
|
+
module Google
|
17
|
+
module Longrunning
|
18
|
+
# This resource represents a long-running operation that is the result of a
|
19
|
+
# network API call.
|
20
|
+
# @!attribute [rw] name
|
21
|
+
# @return [String]
|
22
|
+
# The server-assigned name, which is only unique within the same service that
|
23
|
+
# originally returns it. If you use the default HTTP mapping, the
|
24
|
+
# `name` should have the format of `operations/some/unique/name`.
|
25
|
+
# @!attribute [rw] metadata
|
26
|
+
# @return [Google::Protobuf::Any]
|
27
|
+
# Service-specific metadata associated with the operation. It typically
|
28
|
+
# contains progress information and common metadata such as create time.
|
29
|
+
# Some services might not provide such metadata. Any method that returns a
|
30
|
+
# long-running operation should document the metadata type, if any.
|
31
|
+
# @!attribute [rw] done
|
32
|
+
# @return [true, false]
|
33
|
+
# If the value is `false`, it means the operation is still in progress.
|
34
|
+
# If true, the operation is completed, and either `error` or `response` is
|
35
|
+
# available.
|
36
|
+
# @!attribute [rw] error
|
37
|
+
# @return [Google::Rpc::Status]
|
38
|
+
# The error result of the operation in case of failure or cancellation.
|
39
|
+
# @!attribute [rw] response
|
40
|
+
# @return [Google::Protobuf::Any]
|
41
|
+
# The normal response of the operation in case of success. If the original
|
42
|
+
# method returns no data on success, such as `Delete`, the response is
|
43
|
+
# `google.protobuf.Empty`. If the original method is standard
|
44
|
+
# `Get`/`Create`/`Update`, the response should be the resource. For other
|
45
|
+
# methods, the response should have the type `XxxResponse`, where `Xxx`
|
46
|
+
# is the original method name. For example, if the original method name
|
47
|
+
# is `TakeSnapshot()`, the inferred response type is
|
48
|
+
# `TakeSnapshotResponse`.
|
49
|
+
class Operation; end
|
50
|
+
|
51
|
+
# The request message for {Google::Longrunning::Operations::GetOperation Operations::GetOperation}.
|
52
|
+
# @!attribute [rw] name
|
53
|
+
# @return [String]
|
54
|
+
# The name of the operation resource.
|
55
|
+
class GetOperationRequest; end
|
56
|
+
|
57
|
+
# The request message for {Google::Longrunning::Operations::ListOperations Operations::ListOperations}.
|
58
|
+
# @!attribute [rw] name
|
59
|
+
# @return [String]
|
60
|
+
# The name of the operation collection.
|
61
|
+
# @!attribute [rw] filter
|
62
|
+
# @return [String]
|
63
|
+
# The standard list filter.
|
64
|
+
# @!attribute [rw] page_size
|
65
|
+
# @return [Integer]
|
66
|
+
# The standard list page size.
|
67
|
+
# @!attribute [rw] page_token
|
68
|
+
# @return [String]
|
69
|
+
# The standard list page token.
|
70
|
+
class ListOperationsRequest; end
|
71
|
+
|
72
|
+
# The response message for {Google::Longrunning::Operations::ListOperations Operations::ListOperations}.
|
73
|
+
# @!attribute [rw] operations
|
74
|
+
# @return [Array<Google::Longrunning::Operation>]
|
75
|
+
# A list of operations that matches the specified filter in the request.
|
76
|
+
# @!attribute [rw] next_page_token
|
77
|
+
# @return [String]
|
78
|
+
# The standard List next-page token.
|
79
|
+
class ListOperationsResponse; end
|
80
|
+
|
81
|
+
# The request message for {Google::Longrunning::Operations::CancelOperation Operations::CancelOperation}.
|
82
|
+
# @!attribute [rw] name
|
83
|
+
# @return [String]
|
84
|
+
# The name of the operation resource to be cancelled.
|
85
|
+
class CancelOperationRequest; end
|
86
|
+
|
87
|
+
# The request message for {Google::Longrunning::Operations::DeleteOperation Operations::DeleteOperation}.
|
88
|
+
# @!attribute [rw] name
|
89
|
+
# @return [String]
|
90
|
+
# The name of the operation resource to be deleted.
|
91
|
+
class DeleteOperationRequest; end
|
92
|
+
end
|
93
|
+
end
|
@@ -0,0 +1,130 @@
|
|
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
|
+
module Google
|
17
|
+
module Protobuf
|
18
|
+
# `Any` contains an arbitrary serialized protocol buffer message along with a
|
19
|
+
# URL that describes the type of the serialized message.
|
20
|
+
#
|
21
|
+
# Protobuf library provides support to pack/unpack Any values in the form
|
22
|
+
# of utility functions or additional generated methods of the Any type.
|
23
|
+
#
|
24
|
+
# Example 1: Pack and unpack a message in C++.
|
25
|
+
#
|
26
|
+
# Foo foo = ...;
|
27
|
+
# Any any;
|
28
|
+
# any.PackFrom(foo);
|
29
|
+
# ...
|
30
|
+
# if (any.UnpackTo(&foo)) {
|
31
|
+
# ...
|
32
|
+
# }
|
33
|
+
#
|
34
|
+
# Example 2: Pack and unpack a message in Java.
|
35
|
+
#
|
36
|
+
# Foo foo = ...;
|
37
|
+
# Any any = Any.pack(foo);
|
38
|
+
# ...
|
39
|
+
# if (any.is(Foo.class)) {
|
40
|
+
# foo = any.unpack(Foo.class);
|
41
|
+
# }
|
42
|
+
#
|
43
|
+
# Example 3: Pack and unpack a message in Python.
|
44
|
+
#
|
45
|
+
# foo = Foo(...)
|
46
|
+
# any = Any()
|
47
|
+
# any.Pack(foo)
|
48
|
+
# ...
|
49
|
+
# if any.Is(Foo.DESCRIPTOR):
|
50
|
+
# any.Unpack(foo)
|
51
|
+
# ...
|
52
|
+
#
|
53
|
+
# Example 4: Pack and unpack a message in Go
|
54
|
+
#
|
55
|
+
# foo := &pb.Foo{...}
|
56
|
+
# any, err := ptypes.MarshalAny(foo)
|
57
|
+
# ...
|
58
|
+
# foo := &pb.Foo{}
|
59
|
+
# if err := ptypes.UnmarshalAny(any, foo); err != nil {
|
60
|
+
# ...
|
61
|
+
# }
|
62
|
+
#
|
63
|
+
# The pack methods provided by protobuf library will by default use
|
64
|
+
# 'type.googleapis.com/full.type.name' as the type URL and the unpack
|
65
|
+
# methods only use the fully qualified type name after the last '/'
|
66
|
+
# in the type URL, for example "foo.bar.com/x/y.z" will yield type
|
67
|
+
# name "y.z".
|
68
|
+
#
|
69
|
+
#
|
70
|
+
# = JSON
|
71
|
+
#
|
72
|
+
# The JSON representation of an `Any` value uses the regular
|
73
|
+
# representation of the deserialized, embedded message, with an
|
74
|
+
# additional field `@type` which contains the type URL. Example:
|
75
|
+
#
|
76
|
+
# package google.profile;
|
77
|
+
# message Person {
|
78
|
+
# string first_name = 1;
|
79
|
+
# string last_name = 2;
|
80
|
+
# }
|
81
|
+
#
|
82
|
+
# {
|
83
|
+
# "@type": "type.googleapis.com/google.profile.Person",
|
84
|
+
# "firstName": <string>,
|
85
|
+
# "lastName": <string>
|
86
|
+
# }
|
87
|
+
#
|
88
|
+
# If the embedded message type is well-known and has a custom JSON
|
89
|
+
# representation, that representation will be embedded adding a field
|
90
|
+
# `value` which holds the custom JSON in addition to the `@type`
|
91
|
+
# field. Example (for message {Google::Protobuf::Duration}):
|
92
|
+
#
|
93
|
+
# {
|
94
|
+
# "@type": "type.googleapis.com/google.protobuf.Duration",
|
95
|
+
# "value": "1.212s"
|
96
|
+
# }
|
97
|
+
# @!attribute [rw] type_url
|
98
|
+
# @return [String]
|
99
|
+
# A URL/resource name that uniquely identifies the type of the serialized
|
100
|
+
# protocol buffer message. The last segment of the URL's path must represent
|
101
|
+
# the fully qualified name of the type (as in
|
102
|
+
# `path/google.protobuf.Duration`). The name should be in a canonical form
|
103
|
+
# (e.g., leading "." is not accepted).
|
104
|
+
#
|
105
|
+
# In practice, teams usually precompile into the binary all types that they
|
106
|
+
# expect it to use in the context of Any. However, for URLs which use the
|
107
|
+
# scheme `http`, `https`, or no scheme, one can optionally set up a type
|
108
|
+
# server that maps type URLs to message definitions as follows:
|
109
|
+
#
|
110
|
+
# * If no scheme is provided, `https` is assumed.
|
111
|
+
# * An HTTP GET on the URL must yield a {Google::Protobuf::Type}
|
112
|
+
# value in binary format, or produce an error.
|
113
|
+
# * Applications are allowed to cache lookup results based on the
|
114
|
+
# URL, or have them precompiled into a binary to avoid any
|
115
|
+
# lookup. Therefore, binary compatibility needs to be preserved
|
116
|
+
# on changes to types. (Use versioned type names to manage
|
117
|
+
# breaking changes.)
|
118
|
+
#
|
119
|
+
# Note: this functionality is not currently available in the official
|
120
|
+
# protobuf release, and it is not used for type URLs beginning with
|
121
|
+
# type.googleapis.com.
|
122
|
+
#
|
123
|
+
# Schemes other than `http`, `https` (or the empty scheme) might be
|
124
|
+
# used with implementation specific semantics.
|
125
|
+
# @!attribute [rw] value
|
126
|
+
# @return [String]
|
127
|
+
# Must be a valid serialized protocol buffer of the above specified type.
|
128
|
+
class Any; end
|
129
|
+
end
|
130
|
+
end
|