google-cloud-vision-v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +203 -0
  5. data/README.md +24 -0
  6. data/lib/google-cloud-vision-v1.rb +1 -0
  7. data/lib/google/cloud/common_resources_pb.rb +15 -0
  8. data/lib/google/cloud/vision/v1.rb +20 -0
  9. data/lib/google/cloud/vision/v1/geometry_pb.rb +40 -0
  10. data/lib/google/cloud/vision/v1/image_annotator.rb +21 -0
  11. data/lib/google/cloud/vision/v1/image_annotator/client.rb +682 -0
  12. data/lib/google/cloud/vision/v1/image_annotator/credentials.rb +52 -0
  13. data/lib/google/cloud/vision/v1/image_annotator/helpers.rb +1228 -0
  14. data/lib/google/cloud/vision/v1/image_annotator/operations.rb +558 -0
  15. data/lib/google/cloud/vision/v1/image_annotator/paths.rb +52 -0
  16. data/lib/google/cloud/vision/v1/image_annotator_pb.rb +345 -0
  17. data/lib/google/cloud/vision/v1/image_annotator_services_pb.rb +73 -0
  18. data/lib/google/cloud/vision/v1/product_search.rb +21 -0
  19. data/lib/google/cloud/vision/v1/product_search/client.rb +2134 -0
  20. data/lib/google/cloud/vision/v1/product_search/credentials.rb +52 -0
  21. data/lib/google/cloud/vision/v1/product_search/operations.rb +558 -0
  22. data/lib/google/cloud/vision/v1/product_search/paths.rb +109 -0
  23. data/lib/google/cloud/vision/v1/product_search_pb.rb +55 -0
  24. data/lib/google/cloud/vision/v1/product_search_service_pb.rb +208 -0
  25. data/lib/google/cloud/vision/v1/product_search_service_services_pb.rb +232 -0
  26. data/lib/google/cloud/vision/v1/text_annotation_pb.rb +95 -0
  27. data/lib/google/cloud/vision/v1/version.rb +28 -0
  28. data/lib/google/cloud/vision/v1/web_detection_pb.rb +52 -0
  29. data/proto_docs/README.md +4 -0
  30. data/proto_docs/google/api/field_behavior.rb +59 -0
  31. data/proto_docs/google/api/resource.rb +247 -0
  32. data/proto_docs/google/cloud/vision/v1/geometry.rb +82 -0
  33. data/proto_docs/google/cloud/vision/v1/image_annotator.rb +1044 -0
  34. data/proto_docs/google/cloud/vision/v1/product_search.rb +134 -0
  35. data/proto_docs/google/cloud/vision/v1/product_search_service.rb +669 -0
  36. data/proto_docs/google/cloud/vision/v1/text_annotation.rb +285 -0
  37. data/proto_docs/google/cloud/vision/v1/web_detection.rb +121 -0
  38. data/proto_docs/google/longrunning/operations.rb +150 -0
  39. data/proto_docs/google/protobuf/any.rb +137 -0
  40. data/proto_docs/google/protobuf/empty.rb +36 -0
  41. data/proto_docs/google/protobuf/field_mask.rb +237 -0
  42. data/proto_docs/google/protobuf/timestamp.rb +116 -0
  43. data/proto_docs/google/protobuf/wrappers.rb +121 -0
  44. data/proto_docs/google/rpc/status.rb +46 -0
  45. data/proto_docs/google/type/color.rb +168 -0
  46. data/proto_docs/google/type/latlng.rb +38 -0
  47. metadata +201 -0
@@ -0,0 +1,134 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Vision
23
+ module V1
24
+ # Parameters for a product search request.
25
+ # @!attribute [rw] bounding_poly
26
+ # @return [Google::Cloud::Vision::V1::BoundingPoly]
27
+ # The bounding polygon around the area of interest in the image.
28
+ # Optional. If it is not specified, system discretion will be applied.
29
+ # @!attribute [rw] product_set
30
+ # @return [String]
31
+ # The resource name of a {Google::Cloud::Vision::V1::ProductSet ProductSet} to be searched for similar images.
32
+ #
33
+ # Format is:
34
+ # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
35
+ # @!attribute [rw] product_categories
36
+ # @return [Array<String>]
37
+ # The list of product categories to search in. Currently, we only consider
38
+ # the first category, and either "homegoods-v2", "apparel-v2", "toys-v2",
39
+ # "packagedgoods-v1", or "general-v1" should be specified. The legacy
40
+ # categories "homegoods", "apparel", and "toys" are still supported but will
41
+ # be deprecated. For new products, please use "homegoods-v2", "apparel-v2",
42
+ # or "toys-v2" for better product search accuracy. It is recommended to
43
+ # migrate existing products to these categories as well.
44
+ # @!attribute [rw] filter
45
+ # @return [String]
46
+ # The filtering expression. This can be used to restrict search results based
47
+ # on Product labels. We currently support an AND of OR of key-value
48
+ # expressions, where each expression within an OR must have the same key. An
49
+ # '=' should be used to connect the key and value.
50
+ #
51
+ # For example, "(color = red OR color = blue) AND brand = Google" is
52
+ # acceptable, but "(color = red OR brand = Google)" is not acceptable.
53
+ # "color: red" is not acceptable because it uses a ':' instead of an '='.
54
+ class ProductSearchParams
55
+ include Google::Protobuf::MessageExts
56
+ extend Google::Protobuf::MessageExts::ClassMethods
57
+ end
58
+
59
+ # Results for a product search request.
60
+ # @!attribute [rw] index_time
61
+ # @return [Google::Protobuf::Timestamp]
62
+ # Timestamp of the index which provided these results. Products added to the
63
+ # product set and products removed from the product set after this time are
64
+ # not reflected in the current results.
65
+ # @!attribute [rw] results
66
+ # @return [Array<Google::Cloud::Vision::V1::ProductSearchResults::Result>]
67
+ # List of results, one for each product match.
68
+ # @!attribute [rw] product_grouped_results
69
+ # @return [Array<Google::Cloud::Vision::V1::ProductSearchResults::GroupedResult>]
70
+ # List of results grouped by products detected in the query image. Each entry
71
+ # corresponds to one bounding polygon in the query image, and contains the
72
+ # matching products specific to that region. There may be duplicate product
73
+ # matches in the union of all the per-product results.
74
+ class ProductSearchResults
75
+ include Google::Protobuf::MessageExts
76
+ extend Google::Protobuf::MessageExts::ClassMethods
77
+
78
+ # Information about a product.
79
+ # @!attribute [rw] product
80
+ # @return [Google::Cloud::Vision::V1::Product]
81
+ # The Product.
82
+ # @!attribute [rw] score
83
+ # @return [Float]
84
+ # A confidence level on the match, ranging from 0 (no confidence) to
85
+ # 1 (full confidence).
86
+ # @!attribute [rw] image
87
+ # @return [String]
88
+ # The resource name of the image from the product that is the closest match
89
+ # to the query.
90
+ class Result
91
+ include Google::Protobuf::MessageExts
92
+ extend Google::Protobuf::MessageExts::ClassMethods
93
+ end
94
+
95
+ # Prediction for what the object in the bounding box is.
96
+ # @!attribute [rw] mid
97
+ # @return [String]
98
+ # Object ID that should align with EntityAnnotation mid.
99
+ # @!attribute [rw] language_code
100
+ # @return [String]
101
+ # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
102
+ # information, see
103
+ # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
104
+ # @!attribute [rw] name
105
+ # @return [String]
106
+ # Object name, expressed in its `language_code` language.
107
+ # @!attribute [rw] score
108
+ # @return [Float]
109
+ # Score of the result. Range [0, 1].
110
+ class ObjectAnnotation
111
+ include Google::Protobuf::MessageExts
112
+ extend Google::Protobuf::MessageExts::ClassMethods
113
+ end
114
+
115
+ # Information about the products similar to a single product in a query
116
+ # image.
117
+ # @!attribute [rw] bounding_poly
118
+ # @return [Google::Cloud::Vision::V1::BoundingPoly]
119
+ # The bounding polygon around the product detected in the query image.
120
+ # @!attribute [rw] results
121
+ # @return [Array<Google::Cloud::Vision::V1::ProductSearchResults::Result>]
122
+ # List of results, one for each product match.
123
+ # @!attribute [rw] object_annotations
124
+ # @return [Array<Google::Cloud::Vision::V1::ProductSearchResults::ObjectAnnotation>]
125
+ # List of generic predictions for the object in the bounding box.
126
+ class GroupedResult
127
+ include Google::Protobuf::MessageExts
128
+ extend Google::Protobuf::MessageExts::ClassMethods
129
+ end
130
+ end
131
+ end
132
+ end
133
+ end
134
+ end
@@ -0,0 +1,669 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Vision
23
+ module V1
24
+ # A Product contains ReferenceImages.
25
+ # @!attribute [rw] name
26
+ # @return [String]
27
+ # The resource name of the product.
28
+ #
29
+ # Format is:
30
+ # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
31
+ #
32
+ # This field is ignored when creating a product.
33
+ # @!attribute [rw] display_name
34
+ # @return [String]
35
+ # The user-provided name for this Product. Must not be empty. Must be at most
36
+ # 4096 characters long.
37
+ # @!attribute [rw] description
38
+ # @return [String]
39
+ # User-provided metadata to be stored with this product. Must be at most 4096
40
+ # characters long.
41
+ # @!attribute [rw] product_category
42
+ # @return [String]
43
+ # Immutable. The category for the product identified by the reference image. This should
44
+ # be either "homegoods-v2", "apparel-v2", or "toys-v2". The legacy categories
45
+ # "homegoods", "apparel", and "toys" are still supported, but these should
46
+ # not be used for new products.
47
+ # @!attribute [rw] product_labels
48
+ # @return [Array<Google::Cloud::Vision::V1::Product::KeyValue>]
49
+ # Key-value pairs that can be attached to a product. At query time,
50
+ # constraints can be specified based on the product_labels.
51
+ #
52
+ # Note that integer values can be provided as strings, e.g. "1199". Only
53
+ # strings with integer values can match a range-based restriction which is
54
+ # to be supported soon.
55
+ #
56
+ # Multiple values can be assigned to the same key. One product may have up to
57
+ # 500 product_labels.
58
+ #
59
+ # Notice that the total number of distinct product_labels over all products
60
+ # in one ProductSet cannot exceed 1M, otherwise the product search pipeline
61
+ # will refuse to work for that ProductSet.
62
+ class Product
63
+ include Google::Protobuf::MessageExts
64
+ extend Google::Protobuf::MessageExts::ClassMethods
65
+
66
+ # A product label represented as a key-value pair.
67
+ # @!attribute [rw] key
68
+ # @return [String]
69
+ # The key of the label attached to the product. Cannot be empty and cannot
70
+ # exceed 128 bytes.
71
+ # @!attribute [rw] value
72
+ # @return [String]
73
+ # The value of the label attached to the product. Cannot be empty and
74
+ # cannot exceed 128 bytes.
75
+ class KeyValue
76
+ include Google::Protobuf::MessageExts
77
+ extend Google::Protobuf::MessageExts::ClassMethods
78
+ end
79
+ end
80
+
81
+ # A ProductSet contains Products. A ProductSet can contain a maximum of 1
82
+ # million reference images. If the limit is exceeded, periodic indexing will
83
+ # fail.
84
+ # @!attribute [rw] name
85
+ # @return [String]
86
+ # The resource name of the ProductSet.
87
+ #
88
+ # Format is:
89
+ # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
90
+ #
91
+ # This field is ignored when creating a ProductSet.
92
+ # @!attribute [rw] display_name
93
+ # @return [String]
94
+ # The user-provided name for this ProductSet. Must not be empty. Must be at
95
+ # most 4096 characters long.
96
+ # @!attribute [r] index_time
97
+ # @return [Google::Protobuf::Timestamp]
98
+ # Output only. The time at which this ProductSet was last indexed. Query
99
+ # results will reflect all updates before this time. If this ProductSet has
100
+ # never been indexed, this timestamp is the default value
101
+ # "1970-01-01T00:00:00Z".
102
+ #
103
+ # This field is ignored when creating a ProductSet.
104
+ # @!attribute [r] index_error
105
+ # @return [Google::Rpc::Status]
106
+ # Output only. If there was an error with indexing the product set, the field
107
+ # is populated.
108
+ #
109
+ # This field is ignored when creating a ProductSet.
110
+ class ProductSet
111
+ include Google::Protobuf::MessageExts
112
+ extend Google::Protobuf::MessageExts::ClassMethods
113
+ end
114
+
115
+ # A `ReferenceImage` represents a product image and its associated metadata,
116
+ # such as bounding boxes.
117
+ # @!attribute [rw] name
118
+ # @return [String]
119
+ # The resource name of the reference image.
120
+ #
121
+ # Format is:
122
+ #
123
+ # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
124
+ #
125
+ # This field is ignored when creating a reference image.
126
+ # @!attribute [rw] uri
127
+ # @return [String]
128
+ # Required. The Google Cloud Storage URI of the reference image.
129
+ #
130
+ # The URI must start with `gs://`.
131
+ # @!attribute [rw] bounding_polys
132
+ # @return [Array<Google::Cloud::Vision::V1::BoundingPoly>]
133
+ # Optional. Bounding polygons around the areas of interest in the reference image.
134
+ # If this field is empty, the system will try to detect regions of
135
+ # interest. At most 10 bounding polygons will be used.
136
+ #
137
+ # The provided shape is converted into a non-rotated rectangle. Once
138
+ # converted, the small edge of the rectangle must be greater than or equal
139
+ # to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
140
+ # is not).
141
+ class ReferenceImage
142
+ include Google::Protobuf::MessageExts
143
+ extend Google::Protobuf::MessageExts::ClassMethods
144
+ end
145
+
146
+ # Request message for the `CreateProduct` method.
147
+ # @!attribute [rw] parent
148
+ # @return [String]
149
+ # Required. The project in which the Product should be created.
150
+ #
151
+ # Format is
152
+ # `projects/PROJECT_ID/locations/LOC_ID`.
153
+ # @!attribute [rw] product
154
+ # @return [Google::Cloud::Vision::V1::Product]
155
+ # Required. The product to create.
156
+ # @!attribute [rw] product_id
157
+ # @return [String]
158
+ # A user-supplied resource id for this Product. If set, the server will
159
+ # attempt to use this value as the resource id. If it is already in use, an
160
+ # error is returned with code ALREADY_EXISTS. Must be at most 128 characters
161
+ # long. It cannot contain the character `/`.
162
+ class CreateProductRequest
163
+ include Google::Protobuf::MessageExts
164
+ extend Google::Protobuf::MessageExts::ClassMethods
165
+ end
166
+
167
+ # Request message for the `ListProducts` method.
168
+ # @!attribute [rw] parent
169
+ # @return [String]
170
+ # Required. The project OR ProductSet from which Products should be listed.
171
+ #
172
+ # Format:
173
+ # `projects/PROJECT_ID/locations/LOC_ID`
174
+ # @!attribute [rw] page_size
175
+ # @return [Integer]
176
+ # The maximum number of items to return. Default 10, maximum 100.
177
+ # @!attribute [rw] page_token
178
+ # @return [String]
179
+ # The next_page_token returned from a previous List request, if any.
180
+ class ListProductsRequest
181
+ include Google::Protobuf::MessageExts
182
+ extend Google::Protobuf::MessageExts::ClassMethods
183
+ end
184
+
185
+ # Response message for the `ListProducts` method.
186
+ # @!attribute [rw] products
187
+ # @return [Array<Google::Cloud::Vision::V1::Product>]
188
+ # List of products.
189
+ # @!attribute [rw] next_page_token
190
+ # @return [String]
191
+ # Token to retrieve the next page of results, or empty if there are no more
192
+ # results in the list.
193
+ class ListProductsResponse
194
+ include Google::Protobuf::MessageExts
195
+ extend Google::Protobuf::MessageExts::ClassMethods
196
+ end
197
+
198
+ # Request message for the `GetProduct` method.
199
+ # @!attribute [rw] name
200
+ # @return [String]
201
+ # Required. Resource name of the Product to get.
202
+ #
203
+ # Format is:
204
+ # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
205
+ class GetProductRequest
206
+ include Google::Protobuf::MessageExts
207
+ extend Google::Protobuf::MessageExts::ClassMethods
208
+ end
209
+
210
+ # Request message for the `UpdateProduct` method.
211
+ # @!attribute [rw] product
212
+ # @return [Google::Cloud::Vision::V1::Product]
213
+ # Required. The Product resource which replaces the one on the server.
214
+ # product.name is immutable.
215
+ # @!attribute [rw] update_mask
216
+ # @return [Google::Protobuf::FieldMask]
217
+ # The {Google::Protobuf::FieldMask FieldMask} that specifies which fields
218
+ # to update.
219
+ # If update_mask isn't specified, all mutable fields are to be updated.
220
+ # Valid mask paths include `product_labels`, `display_name`, and
221
+ # `description`.
222
+ class UpdateProductRequest
223
+ include Google::Protobuf::MessageExts
224
+ extend Google::Protobuf::MessageExts::ClassMethods
225
+ end
226
+
227
+ # Request message for the `DeleteProduct` method.
228
+ # @!attribute [rw] name
229
+ # @return [String]
230
+ # Required. Resource name of product to delete.
231
+ #
232
+ # Format is:
233
+ # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
234
+ class DeleteProductRequest
235
+ include Google::Protobuf::MessageExts
236
+ extend Google::Protobuf::MessageExts::ClassMethods
237
+ end
238
+
239
+ # Request message for the `CreateProductSet` method.
240
+ # @!attribute [rw] parent
241
+ # @return [String]
242
+ # Required. The project in which the ProductSet should be created.
243
+ #
244
+ # Format is `projects/PROJECT_ID/locations/LOC_ID`.
245
+ # @!attribute [rw] product_set
246
+ # @return [Google::Cloud::Vision::V1::ProductSet]
247
+ # Required. The ProductSet to create.
248
+ # @!attribute [rw] product_set_id
249
+ # @return [String]
250
+ # A user-supplied resource id for this ProductSet. If set, the server will
251
+ # attempt to use this value as the resource id. If it is already in use, an
252
+ # error is returned with code ALREADY_EXISTS. Must be at most 128 characters
253
+ # long. It cannot contain the character `/`.
254
+ class CreateProductSetRequest
255
+ include Google::Protobuf::MessageExts
256
+ extend Google::Protobuf::MessageExts::ClassMethods
257
+ end
258
+
259
+ # Request message for the `ListProductSets` method.
260
+ # @!attribute [rw] parent
261
+ # @return [String]
262
+ # Required. The project from which ProductSets should be listed.
263
+ #
264
+ # Format is `projects/PROJECT_ID/locations/LOC_ID`.
265
+ # @!attribute [rw] page_size
266
+ # @return [Integer]
267
+ # The maximum number of items to return. Default 10, maximum 100.
268
+ # @!attribute [rw] page_token
269
+ # @return [String]
270
+ # The next_page_token returned from a previous List request, if any.
271
+ class ListProductSetsRequest
272
+ include Google::Protobuf::MessageExts
273
+ extend Google::Protobuf::MessageExts::ClassMethods
274
+ end
275
+
276
+ # Response message for the `ListProductSets` method.
277
+ # @!attribute [rw] product_sets
278
+ # @return [Array<Google::Cloud::Vision::V1::ProductSet>]
279
+ # List of ProductSets.
280
+ # @!attribute [rw] next_page_token
281
+ # @return [String]
282
+ # Token to retrieve the next page of results, or empty if there are no more
283
+ # results in the list.
284
+ class ListProductSetsResponse
285
+ include Google::Protobuf::MessageExts
286
+ extend Google::Protobuf::MessageExts::ClassMethods
287
+ end
288
+
289
+ # Request message for the `GetProductSet` method.
290
+ # @!attribute [rw] name
291
+ # @return [String]
292
+ # Required. Resource name of the ProductSet to get.
293
+ #
294
+ # Format is:
295
+ # `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID`
296
+ class GetProductSetRequest
297
+ include Google::Protobuf::MessageExts
298
+ extend Google::Protobuf::MessageExts::ClassMethods
299
+ end
300
+
301
+ # Request message for the `UpdateProductSet` method.
302
+ # @!attribute [rw] product_set
303
+ # @return [Google::Cloud::Vision::V1::ProductSet]
304
+ # Required. The ProductSet resource which replaces the one on the server.
305
+ # @!attribute [rw] update_mask
306
+ # @return [Google::Protobuf::FieldMask]
307
+ # The {Google::Protobuf::FieldMask FieldMask} that specifies which fields to
308
+ # update.
309
+ # If update_mask isn't specified, all mutable fields are to be updated.
310
+ # Valid mask path is `display_name`.
311
+ class UpdateProductSetRequest
312
+ include Google::Protobuf::MessageExts
313
+ extend Google::Protobuf::MessageExts::ClassMethods
314
+ end
315
+
316
+ # Request message for the `DeleteProductSet` method.
317
+ # @!attribute [rw] name
318
+ # @return [String]
319
+ # Required. Resource name of the ProductSet to delete.
320
+ #
321
+ # Format is:
322
+ # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
323
+ class DeleteProductSetRequest
324
+ include Google::Protobuf::MessageExts
325
+ extend Google::Protobuf::MessageExts::ClassMethods
326
+ end
327
+
328
+ # Request message for the `CreateReferenceImage` method.
329
+ # @!attribute [rw] parent
330
+ # @return [String]
331
+ # Required. Resource name of the product in which to create the reference image.
332
+ #
333
+ # Format is
334
+ # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
335
+ # @!attribute [rw] reference_image
336
+ # @return [Google::Cloud::Vision::V1::ReferenceImage]
337
+ # Required. The reference image to create.
338
+ # If an image ID is specified, it is ignored.
339
+ # @!attribute [rw] reference_image_id
340
+ # @return [String]
341
+ # A user-supplied resource id for the ReferenceImage to be added. If set,
342
+ # the server will attempt to use this value as the resource id. If it is
343
+ # already in use, an error is returned with code ALREADY_EXISTS. Must be at
344
+ # most 128 characters long. It cannot contain the character `/`.
345
+ class CreateReferenceImageRequest
346
+ include Google::Protobuf::MessageExts
347
+ extend Google::Protobuf::MessageExts::ClassMethods
348
+ end
349
+
350
+ # Request message for the `ListReferenceImages` method.
351
+ # @!attribute [rw] parent
352
+ # @return [String]
353
+ # Required. Resource name of the product containing the reference images.
354
+ #
355
+ # Format is
356
+ # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
357
+ # @!attribute [rw] page_size
358
+ # @return [Integer]
359
+ # The maximum number of items to return. Default 10, maximum 100.
360
+ # @!attribute [rw] page_token
361
+ # @return [String]
362
+ # A token identifying a page of results to be returned. This is the value
363
+ # of `nextPageToken` returned in a previous reference image list request.
364
+ #
365
+ # Defaults to the first page if not specified.
366
+ class ListReferenceImagesRequest
367
+ include Google::Protobuf::MessageExts
368
+ extend Google::Protobuf::MessageExts::ClassMethods
369
+ end
370
+
371
+ # Response message for the `ListReferenceImages` method.
372
+ # @!attribute [rw] reference_images
373
+ # @return [Array<Google::Cloud::Vision::V1::ReferenceImage>]
374
+ # The list of reference images.
375
+ # @!attribute [rw] page_size
376
+ # @return [Integer]
377
+ # The maximum number of items to return. Default 10, maximum 100.
378
+ # @!attribute [rw] next_page_token
379
+ # @return [String]
380
+ # The next_page_token returned from a previous List request, if any.
381
+ class ListReferenceImagesResponse
382
+ include Google::Protobuf::MessageExts
383
+ extend Google::Protobuf::MessageExts::ClassMethods
384
+ end
385
+
386
+ # Request message for the `GetReferenceImage` method.
387
+ # @!attribute [rw] name
388
+ # @return [String]
389
+ # Required. The resource name of the ReferenceImage to get.
390
+ #
391
+ # Format is:
392
+ #
393
+ # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
394
+ class GetReferenceImageRequest
395
+ include Google::Protobuf::MessageExts
396
+ extend Google::Protobuf::MessageExts::ClassMethods
397
+ end
398
+
399
+ # Request message for the `DeleteReferenceImage` method.
400
+ # @!attribute [rw] name
401
+ # @return [String]
402
+ # Required. The resource name of the reference image to delete.
403
+ #
404
+ # Format is:
405
+ #
406
+ # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`
407
+ class DeleteReferenceImageRequest
408
+ include Google::Protobuf::MessageExts
409
+ extend Google::Protobuf::MessageExts::ClassMethods
410
+ end
411
+
412
+ # Request message for the `AddProductToProductSet` method.
413
+ # @!attribute [rw] name
414
+ # @return [String]
415
+ # Required. The resource name for the ProductSet to modify.
416
+ #
417
+ # Format is:
418
+ # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
419
+ # @!attribute [rw] product
420
+ # @return [String]
421
+ # Required. The resource name for the Product to be added to this ProductSet.
422
+ #
423
+ # Format is:
424
+ # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
425
+ class AddProductToProductSetRequest
426
+ include Google::Protobuf::MessageExts
427
+ extend Google::Protobuf::MessageExts::ClassMethods
428
+ end
429
+
430
+ # Request message for the `RemoveProductFromProductSet` method.
431
+ # @!attribute [rw] name
432
+ # @return [String]
433
+ # Required. The resource name for the ProductSet to modify.
434
+ #
435
+ # Format is:
436
+ # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
437
+ # @!attribute [rw] product
438
+ # @return [String]
439
+ # Required. The resource name for the Product to be removed from this ProductSet.
440
+ #
441
+ # Format is:
442
+ # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
443
+ class RemoveProductFromProductSetRequest
444
+ include Google::Protobuf::MessageExts
445
+ extend Google::Protobuf::MessageExts::ClassMethods
446
+ end
447
+
448
+ # Request message for the `ListProductsInProductSet` method.
449
+ # @!attribute [rw] name
450
+ # @return [String]
451
+ # Required. The ProductSet resource for which to retrieve Products.
452
+ #
453
+ # Format is:
454
+ # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
455
+ # @!attribute [rw] page_size
456
+ # @return [Integer]
457
+ # The maximum number of items to return. Default 10, maximum 100.
458
+ # @!attribute [rw] page_token
459
+ # @return [String]
460
+ # The next_page_token returned from a previous List request, if any.
461
+ class ListProductsInProductSetRequest
462
+ include Google::Protobuf::MessageExts
463
+ extend Google::Protobuf::MessageExts::ClassMethods
464
+ end
465
+
466
+ # Response message for the `ListProductsInProductSet` method.
467
+ # @!attribute [rw] products
468
+ # @return [Array<Google::Cloud::Vision::V1::Product>]
469
+ # The list of Products.
470
+ # @!attribute [rw] next_page_token
471
+ # @return [String]
472
+ # Token to retrieve the next page of results, or empty if there are no more
473
+ # results in the list.
474
+ class ListProductsInProductSetResponse
475
+ include Google::Protobuf::MessageExts
476
+ extend Google::Protobuf::MessageExts::ClassMethods
477
+ end
478
+
479
+ # The Google Cloud Storage location for a csv file which preserves a list of
480
+ # ImportProductSetRequests in each line.
481
+ # @!attribute [rw] csv_file_uri
482
+ # @return [String]
483
+ # The Google Cloud Storage URI of the input csv file.
484
+ #
485
+ # The URI must start with `gs://`.
486
+ #
487
+ # The format of the input csv file should be one image per line.
488
+ # In each line, there are 8 columns.
489
+ #
490
+ # 1. image-uri
491
+ # 2. image-id
492
+ # 3. product-set-id
493
+ # 4. product-id
494
+ # 5. product-category
495
+ # 6. product-display-name
496
+ # 7. labels
497
+ # 8. bounding-poly
498
+ #
499
+ # The `image-uri`, `product-set-id`, `product-id`, and `product-category`
500
+ # columns are required. All other columns are optional.
501
+ #
502
+ # If the `ProductSet` or `Product` specified by the `product-set-id` and
503
+ # `product-id` values does not exist, then the system will create a new
504
+ # `ProductSet` or `Product` for the image. In this case, the
505
+ # `product-display-name` column refers to
506
+ # {Google::Cloud::Vision::V1::Product#display_name display_name}, the
507
+ # `product-category` column refers to
508
+ # {Google::Cloud::Vision::V1::Product#product_category product_category}, and the
509
+ # `labels` column refers to {Google::Cloud::Vision::V1::Product#product_labels product_labels}.
510
+ #
511
+ # The `image-id` column is optional but must be unique if provided. If it is
512
+ # empty, the system will automatically assign a unique id to the image.
513
+ #
514
+ # The `product-display-name` column is optional. If it is empty, the system
515
+ # sets the {Google::Cloud::Vision::V1::Product#display_name display_name} field for the product to a
516
+ # space (" "). You can update the `display_name` later by using the API.
517
+ #
518
+ # If a `Product` with the specified `product-id` already exists, then the
519
+ # system ignores the `product-display-name`, `product-category`, and `labels`
520
+ # columns.
521
+ #
522
+ # The `labels` column (optional) is a line containing a list of
523
+ # comma-separated key-value pairs, in the following format:
524
+ #
525
+ # "key_1=value_1,key_2=value_2,...,key_n=value_n"
526
+ #
527
+ # The `bounding-poly` column (optional) identifies one region of
528
+ # interest from the image in the same manner as `CreateReferenceImage`. If
529
+ # you do not specify the `bounding-poly` column, then the system will try to
530
+ # detect regions of interest automatically.
531
+ #
532
+ # At most one `bounding-poly` column is allowed per line. If the image
533
+ # contains multiple regions of interest, add a line to the CSV file that
534
+ # includes the same product information, and the `bounding-poly` values for
535
+ # each region of interest.
536
+ #
537
+ # The `bounding-poly` column must contain an even number of comma-separated
538
+ # numbers, in the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use
539
+ # non-negative integers for absolute bounding polygons, and float values
540
+ # in [0, 1] for normalized bounding polygons.
541
+ #
542
+ # The system will resize the image if the image resolution is too
543
+ # large to process (larger than 20MP).
544
+ class ImportProductSetsGcsSource
545
+ include Google::Protobuf::MessageExts
546
+ extend Google::Protobuf::MessageExts::ClassMethods
547
+ end
548
+
549
+ # The input content for the `ImportProductSets` method.
550
+ # @!attribute [rw] gcs_source
551
+ # @return [Google::Cloud::Vision::V1::ImportProductSetsGcsSource]
552
+ # The Google Cloud Storage location for a csv file which preserves a list
553
+ # of ImportProductSetRequests in each line.
554
+ class ImportProductSetsInputConfig
555
+ include Google::Protobuf::MessageExts
556
+ extend Google::Protobuf::MessageExts::ClassMethods
557
+ end
558
+
559
+ # Request message for the `ImportProductSets` method.
560
+ # @!attribute [rw] parent
561
+ # @return [String]
562
+ # Required. The project in which the ProductSets should be imported.
563
+ #
564
+ # Format is `projects/PROJECT_ID/locations/LOC_ID`.
565
+ # @!attribute [rw] input_config
566
+ # @return [Google::Cloud::Vision::V1::ImportProductSetsInputConfig]
567
+ # Required. The input content for the list of requests.
568
+ class ImportProductSetsRequest
569
+ include Google::Protobuf::MessageExts
570
+ extend Google::Protobuf::MessageExts::ClassMethods
571
+ end
572
+
573
+ # Response message for the `ImportProductSets` method.
574
+ #
575
+ # This message is returned by the
576
+ # google.longrunning.Operations.GetOperation method in the returned
577
+ # {Google::Longrunning::Operation#response google.longrunning.Operation.response} field.
578
+ # @!attribute [rw] reference_images
579
+ # @return [Array<Google::Cloud::Vision::V1::ReferenceImage>]
580
+ # The list of reference_images that are imported successfully.
581
+ # @!attribute [rw] statuses
582
+ # @return [Array<Google::Rpc::Status>]
583
+ # The rpc status for each ImportProductSet request, including both successes
584
+ # and errors.
585
+ #
586
+ # The number of statuses here matches the number of lines in the csv file,
587
+ # and statuses[i] stores the success or failure status of processing the i-th
588
+ # line of the csv, starting from line 0.
589
+ class ImportProductSetsResponse
590
+ include Google::Protobuf::MessageExts
591
+ extend Google::Protobuf::MessageExts::ClassMethods
592
+ end
593
+
594
+ # Metadata for the batch operations such as the current state.
595
+ #
596
+ # This is included in the `metadata` field of the `Operation` returned by the
597
+ # `GetOperation` call of the `google::longrunning::Operations` service.
598
+ # @!attribute [rw] state
599
+ # @return [Google::Cloud::Vision::V1::BatchOperationMetadata::State]
600
+ # The current state of the batch operation.
601
+ # @!attribute [rw] submit_time
602
+ # @return [Google::Protobuf::Timestamp]
603
+ # The time when the batch request was submitted to the server.
604
+ # @!attribute [rw] end_time
605
+ # @return [Google::Protobuf::Timestamp]
606
+ # The time when the batch request is finished and
607
+ # {Google::Longrunning::Operation#done google.longrunning.Operation.done} is set to true.
608
+ class BatchOperationMetadata
609
+ include Google::Protobuf::MessageExts
610
+ extend Google::Protobuf::MessageExts::ClassMethods
611
+
612
+ # Enumerates the possible states that the batch request can be in.
613
+ module State
614
+ # Invalid.
615
+ STATE_UNSPECIFIED = 0
616
+
617
+ # Request is actively being processed.
618
+ PROCESSING = 1
619
+
620
+ # The request is done and at least one item has been successfully
621
+ # processed.
622
+ SUCCESSFUL = 2
623
+
624
+ # The request is done and no item has been successfully processed.
625
+ FAILED = 3
626
+
627
+ # The request is done after the longrunning.Operations.CancelOperation has
628
+ # been called by the user. Any records that were processed before the
629
+ # cancel command are output as specified in the request.
630
+ CANCELLED = 4
631
+ end
632
+ end
633
+
634
+ # Config to control which ProductSet contains the Products to be deleted.
635
+ # @!attribute [rw] product_set_id
636
+ # @return [String]
637
+ # The ProductSet that contains the Products to delete. If a Product is a
638
+ # member of product_set_id in addition to other ProductSets, the Product will
639
+ # still be deleted.
640
+ class ProductSetPurgeConfig
641
+ include Google::Protobuf::MessageExts
642
+ extend Google::Protobuf::MessageExts::ClassMethods
643
+ end
644
+
645
+ # Request message for the `PurgeProducts` method.
646
+ # @!attribute [rw] product_set_purge_config
647
+ # @return [Google::Cloud::Vision::V1::ProductSetPurgeConfig]
648
+ # Specify which ProductSet contains the Products to be deleted.
649
+ # @!attribute [rw] delete_orphan_products
650
+ # @return [Boolean]
651
+ # If delete_orphan_products is true, all Products that are not in any
652
+ # ProductSet will be deleted.
653
+ # @!attribute [rw] parent
654
+ # @return [String]
655
+ # Required. The project and location in which the Products should be deleted.
656
+ #
657
+ # Format is `projects/PROJECT_ID/locations/LOC_ID`.
658
+ # @!attribute [rw] force
659
+ # @return [Boolean]
660
+ # The default value is false. Override this value to true to actually perform
661
+ # the purge.
662
+ class PurgeProductsRequest
663
+ include Google::Protobuf::MessageExts
664
+ extend Google::Protobuf::MessageExts::ClassMethods
665
+ end
666
+ end
667
+ end
668
+ end
669
+ end