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,154 @@
|
|
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
|
+
# Parameters for a product search request.
|
21
|
+
# @!attribute [rw] catalog_name
|
22
|
+
# @return [String]
|
23
|
+
# The resource name of the catalog to search.
|
24
|
+
#
|
25
|
+
# Format is: `productSearch/catalogs/CATALOG_NAME`.
|
26
|
+
# @!attribute [rw] category
|
27
|
+
# @return [Google::Cloud::Vision::V1p3beta1::ProductSearchCategory]
|
28
|
+
# The category to search in.
|
29
|
+
# Optional. It is inferred by the system if it is not specified.
|
30
|
+
# [Deprecated] Use `product_category`.
|
31
|
+
# @!attribute [rw] product_category
|
32
|
+
# @return [String]
|
33
|
+
# The product category to search in.
|
34
|
+
# Optional. It is inferred by the system if it is not specified.
|
35
|
+
# Supported values are `bag`, `shoe`, `sunglasses`, `dress`, `outerwear`,
|
36
|
+
# `skirt`, `top`, `shorts`, and `pants`.
|
37
|
+
# @!attribute [rw] normalized_bounding_poly
|
38
|
+
# @return [Google::Cloud::Vision::V1p3beta1::NormalizedBoundingPoly]
|
39
|
+
# The bounding polygon around the area of interest in the image.
|
40
|
+
# Optional. If it is not specified, system discretion will be applied.
|
41
|
+
# [Deprecated] Use `bounding_poly`.
|
42
|
+
# @!attribute [rw] bounding_poly
|
43
|
+
# @return [Google::Cloud::Vision::V1p3beta1::BoundingPoly]
|
44
|
+
# The bounding polygon around the area of interest in the image.
|
45
|
+
# Optional. If it is not specified, system discretion will be applied.
|
46
|
+
# @!attribute [rw] view
|
47
|
+
# @return [Google::Cloud::Vision::V1p3beta1::ProductSearchResultsView]
|
48
|
+
# Specifies the verbosity of the product search results.
|
49
|
+
# Optional. Defaults to `BASIC`.
|
50
|
+
# @!attribute [rw] product_set
|
51
|
+
# @return [String]
|
52
|
+
# The resource name of a {Google::Cloud::Vision::V1p3beta1::ProductSet ProductSet} to be searched for similar images.
|
53
|
+
#
|
54
|
+
# Format is:
|
55
|
+
# `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
|
56
|
+
# @!attribute [rw] product_categories
|
57
|
+
# @return [Array<String>]
|
58
|
+
# The list of product categories to search in. Currently, we only consider
|
59
|
+
# the first category, and either "homegoods" or "apparel" should be
|
60
|
+
# specified.
|
61
|
+
# @!attribute [rw] filter
|
62
|
+
# @return [String]
|
63
|
+
# The filtering expression. This can be used to restrict search results based
|
64
|
+
# on Product labels. We currently support an AND of OR of key-value
|
65
|
+
# expressions, where each expression within an OR must have the same key.
|
66
|
+
#
|
67
|
+
# For example, "(color = red OR color = blue) AND brand = Google" is
|
68
|
+
# acceptable, but not "(color = red OR brand = Google)" or "color: red".
|
69
|
+
class ProductSearchParams; end
|
70
|
+
|
71
|
+
# Results for a product search request.
|
72
|
+
# @!attribute [rw] category
|
73
|
+
# @return [Google::Cloud::Vision::V1p3beta1::ProductSearchCategory]
|
74
|
+
# Product category.
|
75
|
+
# [Deprecated] Use `product_category`.
|
76
|
+
# @!attribute [rw] product_category
|
77
|
+
# @return [String]
|
78
|
+
# Product category.
|
79
|
+
# Supported values are `bag` and `shoe`.
|
80
|
+
# [Deprecated] `product_category` is provided in each Product.
|
81
|
+
# @!attribute [rw] index_time
|
82
|
+
# @return [Google::Protobuf::Timestamp]
|
83
|
+
# Timestamp of the index which provided these results. Changes made after
|
84
|
+
# this time are not reflected in the current results.
|
85
|
+
# @!attribute [rw] products
|
86
|
+
# @return [Array<Google::Cloud::Vision::V1p3beta1::ProductSearchResults::ProductInfo>]
|
87
|
+
# List of detected products.
|
88
|
+
# @!attribute [rw] results
|
89
|
+
# @return [Array<Google::Cloud::Vision::V1p3beta1::ProductSearchResults::Result>]
|
90
|
+
# List of results, one for each product match.
|
91
|
+
class ProductSearchResults
|
92
|
+
# Information about a product.
|
93
|
+
# @!attribute [rw] product_id
|
94
|
+
# @return [String]
|
95
|
+
# Product ID.
|
96
|
+
# @!attribute [rw] image_uri
|
97
|
+
# @return [String]
|
98
|
+
# The URI of the image which matched the query image.
|
99
|
+
#
|
100
|
+
# This field is returned only if `view` is set to `FULL` in
|
101
|
+
# the request.
|
102
|
+
# @!attribute [rw] score
|
103
|
+
# @return [Float]
|
104
|
+
# A confidence level on the match, ranging from 0 (no confidence) to
|
105
|
+
# 1 (full confidence).
|
106
|
+
#
|
107
|
+
# This field is returned only if `view` is set to `FULL` in
|
108
|
+
# the request.
|
109
|
+
class ProductInfo; end
|
110
|
+
|
111
|
+
# Information about a product.
|
112
|
+
# @!attribute [rw] product
|
113
|
+
# @return [Google::Cloud::Vision::V1p3beta1::Product]
|
114
|
+
# The Product.
|
115
|
+
# @!attribute [rw] score
|
116
|
+
# @return [Float]
|
117
|
+
# A confidence level on the match, ranging from 0 (no confidence) to
|
118
|
+
# 1 (full confidence).
|
119
|
+
#
|
120
|
+
# This field is returned only if `view` is set to `FULL` in
|
121
|
+
# the request.
|
122
|
+
# @!attribute [rw] image
|
123
|
+
# @return [String]
|
124
|
+
# The resource name of the image from the product that is the closest match
|
125
|
+
# to the query.
|
126
|
+
class Result; end
|
127
|
+
end
|
128
|
+
|
129
|
+
# Supported product search categories.
|
130
|
+
module ProductSearchCategory
|
131
|
+
# Default value used when a category is not specified.
|
132
|
+
PRODUCT_SEARCH_CATEGORY_UNSPECIFIED = 0
|
133
|
+
|
134
|
+
# Shoes category.
|
135
|
+
SHOES = 1
|
136
|
+
|
137
|
+
# Bags category.
|
138
|
+
BAGS = 2
|
139
|
+
end
|
140
|
+
|
141
|
+
# Specifies the fields to include in product search results.
|
142
|
+
module ProductSearchResultsView
|
143
|
+
# Product search results contain only `product_category` and `product_id`.
|
144
|
+
# Default value.
|
145
|
+
BASIC = 0
|
146
|
+
|
147
|
+
# Product search results contain `product_category`, `product_id`,
|
148
|
+
# `image_uri`, and `score`.
|
149
|
+
FULL = 1
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
data/lib/google/cloud/vision/v1p3beta1/doc/google/cloud/vision/v1p3beta1/product_search_service.rb
ADDED
@@ -0,0 +1,533 @@
|
|
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
|
+
# A Product contains ReferenceImages.
|
21
|
+
# @!attribute [rw] name
|
22
|
+
# @return [String]
|
23
|
+
# The resource name of the product.
|
24
|
+
#
|
25
|
+
# Format is:
|
26
|
+
# `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
|
27
|
+
#
|
28
|
+
# This field is ignored when creating a product.
|
29
|
+
# @!attribute [rw] display_name
|
30
|
+
# @return [String]
|
31
|
+
# The user-provided name for this Product. Must not be empty. Must be at most
|
32
|
+
# 4096 characters long.
|
33
|
+
# @!attribute [rw] description
|
34
|
+
# @return [String]
|
35
|
+
# User-provided metadata to be stored with this product. Must be at most 4096
|
36
|
+
# characters long.
|
37
|
+
# @!attribute [rw] product_category
|
38
|
+
# @return [String]
|
39
|
+
# The category for the product identified by the reference image. This should
|
40
|
+
# be either "homegoods" or "apparel".
|
41
|
+
#
|
42
|
+
# This field is immutable.
|
43
|
+
# @!attribute [rw] product_labels
|
44
|
+
# @return [Array<Google::Cloud::Vision::V1p3beta1::Product::KeyValue>]
|
45
|
+
# Key-value pairs that can be attached to a product. At query time,
|
46
|
+
# constraints can be specified based on the product_labels.
|
47
|
+
#
|
48
|
+
# Note that integer values can be provided as strings, e.g. "1199". Only
|
49
|
+
# strings with integer values can match a range-based restriction which is
|
50
|
+
# to be supported soon.
|
51
|
+
#
|
52
|
+
# Multiple values can be assigned to the same key. One product may have up to
|
53
|
+
# 100 product_labels.
|
54
|
+
class Product
|
55
|
+
# A product label represented as a key-value pair.
|
56
|
+
# @!attribute [rw] key
|
57
|
+
# @return [String]
|
58
|
+
# The key of the label attached to the product. Cannot be empty and cannot
|
59
|
+
# exceed 128 bytes.
|
60
|
+
# @!attribute [rw] value
|
61
|
+
# @return [String]
|
62
|
+
# The value of the label attached to the product. Cannot be empty and
|
63
|
+
# cannot exceed 128 bytes.
|
64
|
+
class KeyValue; end
|
65
|
+
end
|
66
|
+
|
67
|
+
# A ProductSet contains Products. A ProductSet can contain a maximum of 1
|
68
|
+
# million reference images. If the limit is exceeded, periodic indexing will
|
69
|
+
# fail.
|
70
|
+
# @!attribute [rw] name
|
71
|
+
# @return [String]
|
72
|
+
# The resource name of the ProductSet.
|
73
|
+
#
|
74
|
+
# Format is:
|
75
|
+
# `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
|
76
|
+
#
|
77
|
+
# This field is ignored when creating a ProductSet.
|
78
|
+
# @!attribute [rw] display_name
|
79
|
+
# @return [String]
|
80
|
+
# The user-provided name for this ProductSet. Must not be empty. Must be at
|
81
|
+
# most 4096 characters long.
|
82
|
+
# @!attribute [rw] index_time
|
83
|
+
# @return [Google::Protobuf::Timestamp]
|
84
|
+
# Output only. The time at which this ProductSet was last indexed. Query
|
85
|
+
# results will reflect all updates before this time. If this ProductSet has
|
86
|
+
# never been indexed, this field is 0.
|
87
|
+
#
|
88
|
+
# This field is ignored when creating a ProductSet.
|
89
|
+
# @!attribute [rw] index_error
|
90
|
+
# @return [Google::Rpc::Status]
|
91
|
+
# Output only. If there was an error with indexing the product set, the field
|
92
|
+
# is populated.
|
93
|
+
#
|
94
|
+
# This field is ignored when creating a ProductSet.
|
95
|
+
class ProductSet; end
|
96
|
+
|
97
|
+
# A `ReferenceImage` represents a product image and its associated metadata,
|
98
|
+
# such as bounding boxes.
|
99
|
+
# @!attribute [rw] name
|
100
|
+
# @return [String]
|
101
|
+
# The resource name of the reference image.
|
102
|
+
#
|
103
|
+
# Format is:
|
104
|
+
#
|
105
|
+
# `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
|
106
|
+
#
|
107
|
+
# This field is ignored when creating a reference image.
|
108
|
+
# @!attribute [rw] uri
|
109
|
+
# @return [String]
|
110
|
+
# The Google Cloud Storage URI of the reference image.
|
111
|
+
#
|
112
|
+
# The URI must start with `gs://`.
|
113
|
+
#
|
114
|
+
# Required.
|
115
|
+
# @!attribute [rw] bounding_polys
|
116
|
+
# @return [Array<Google::Cloud::Vision::V1p3beta1::BoundingPoly>]
|
117
|
+
# Bounding polygons around the areas of interest in the reference image.
|
118
|
+
# Optional. If this field is empty, the system will try to detect regions of
|
119
|
+
# interest. At most 10 bounding polygons will be used.
|
120
|
+
#
|
121
|
+
# The provided shape is converted into a non-rotated rectangle. Once
|
122
|
+
# converted, the small edge of the rectangle must be greater than or equal
|
123
|
+
# to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
|
124
|
+
# is not).
|
125
|
+
class ReferenceImage; end
|
126
|
+
|
127
|
+
# Request message for the `CreateProduct` method.
|
128
|
+
# @!attribute [rw] parent
|
129
|
+
# @return [String]
|
130
|
+
# The project in which the Product should be created.
|
131
|
+
#
|
132
|
+
# Format is
|
133
|
+
# `projects/PROJECT_ID/locations/LOC_ID`.
|
134
|
+
# @!attribute [rw] product
|
135
|
+
# @return [Google::Cloud::Vision::V1p3beta1::Product]
|
136
|
+
# The product to create.
|
137
|
+
# @!attribute [rw] product_id
|
138
|
+
# @return [String]
|
139
|
+
# A user-supplied resource id for this Product. If set, the server will
|
140
|
+
# attempt to use this value as the resource id. If it is already in use, an
|
141
|
+
# error is returned with code ALREADY_EXISTS. Must be at most 128 characters
|
142
|
+
# long. It cannot contain the character `/`.
|
143
|
+
class CreateProductRequest; end
|
144
|
+
|
145
|
+
# Request message for the `ListProducts` method.
|
146
|
+
# @!attribute [rw] parent
|
147
|
+
# @return [String]
|
148
|
+
# The project OR ProductSet from which Products should be listed.
|
149
|
+
#
|
150
|
+
# Format:
|
151
|
+
# `projects/PROJECT_ID/locations/LOC_ID`
|
152
|
+
# @!attribute [rw] page_size
|
153
|
+
# @return [Integer]
|
154
|
+
# The maximum number of items to return. Default 10, maximum 100.
|
155
|
+
# @!attribute [rw] page_token
|
156
|
+
# @return [String]
|
157
|
+
# The next_page_token returned from a previous List request, if any.
|
158
|
+
class ListProductsRequest; end
|
159
|
+
|
160
|
+
# Response message for the `ListProducts` method.
|
161
|
+
# @!attribute [rw] products
|
162
|
+
# @return [Array<Google::Cloud::Vision::V1p3beta1::Product>]
|
163
|
+
# List of products.
|
164
|
+
# @!attribute [rw] next_page_token
|
165
|
+
# @return [String]
|
166
|
+
# Token to retrieve the next page of results, or empty if there are no more
|
167
|
+
# results in the list.
|
168
|
+
class ListProductsResponse; end
|
169
|
+
|
170
|
+
# Request message for the `GetProduct` method.
|
171
|
+
# @!attribute [rw] name
|
172
|
+
# @return [String]
|
173
|
+
# Resource name of the Product to get.
|
174
|
+
#
|
175
|
+
# Format is:
|
176
|
+
# `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
|
177
|
+
class GetProductRequest; end
|
178
|
+
|
179
|
+
# Request message for the `UpdateProduct` method.
|
180
|
+
# @!attribute [rw] product
|
181
|
+
# @return [Google::Cloud::Vision::V1p3beta1::Product]
|
182
|
+
# The Product resource which replaces the one on the server.
|
183
|
+
# product.name is immutable.
|
184
|
+
# @!attribute [rw] update_mask
|
185
|
+
# @return [Google::Protobuf::FieldMask]
|
186
|
+
# The {Google::Protobuf::FieldMask FieldMask} that specifies which fields
|
187
|
+
# to update.
|
188
|
+
# If update_mask isn't specified, all mutable fields are to be updated.
|
189
|
+
# Valid mask paths include `product_labels`, `display_name` and
|
190
|
+
# `description`.
|
191
|
+
class UpdateProductRequest; end
|
192
|
+
|
193
|
+
# Request message for the `DeleteProduct` method.
|
194
|
+
# @!attribute [rw] name
|
195
|
+
# @return [String]
|
196
|
+
# Resource name of product to delete.
|
197
|
+
#
|
198
|
+
# Format is:
|
199
|
+
# `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
|
200
|
+
class DeleteProductRequest; end
|
201
|
+
|
202
|
+
# Request message for the `CreateProductSet` method.
|
203
|
+
# @!attribute [rw] parent
|
204
|
+
# @return [String]
|
205
|
+
# The project in which the ProductSet should be created.
|
206
|
+
#
|
207
|
+
# Format is `projects/PROJECT_ID/locations/LOC_ID`.
|
208
|
+
# @!attribute [rw] product_set
|
209
|
+
# @return [Google::Cloud::Vision::V1p3beta1::ProductSet]
|
210
|
+
# The ProductSet to create.
|
211
|
+
# @!attribute [rw] product_set_id
|
212
|
+
# @return [String]
|
213
|
+
# A user-supplied resource id for this ProductSet. If set, the server will
|
214
|
+
# attempt to use this value as the resource id. If it is already in use, an
|
215
|
+
# error is returned with code ALREADY_EXISTS. Must be at most 128 characters
|
216
|
+
# long. It cannot contain the character `/`.
|
217
|
+
class CreateProductSetRequest; end
|
218
|
+
|
219
|
+
# Request message for the `ListProductSets` method.
|
220
|
+
# @!attribute [rw] parent
|
221
|
+
# @return [String]
|
222
|
+
# The project from which ProductSets should be listed.
|
223
|
+
#
|
224
|
+
# Format is `projects/PROJECT_ID/locations/LOC_ID`.
|
225
|
+
# @!attribute [rw] page_size
|
226
|
+
# @return [Integer]
|
227
|
+
# The maximum number of items to return. Default 10, maximum 100.
|
228
|
+
# @!attribute [rw] page_token
|
229
|
+
# @return [String]
|
230
|
+
# The next_page_token returned from a previous List request, if any.
|
231
|
+
class ListProductSetsRequest; end
|
232
|
+
|
233
|
+
# Response message for the `ListProductSets` method.
|
234
|
+
# @!attribute [rw] product_sets
|
235
|
+
# @return [Array<Google::Cloud::Vision::V1p3beta1::ProductSet>]
|
236
|
+
# List of ProductSets.
|
237
|
+
# @!attribute [rw] next_page_token
|
238
|
+
# @return [String]
|
239
|
+
# Token to retrieve the next page of results, or empty if there are no more
|
240
|
+
# results in the list.
|
241
|
+
class ListProductSetsResponse; end
|
242
|
+
|
243
|
+
# Request message for the `GetProductSet` method.
|
244
|
+
# @!attribute [rw] name
|
245
|
+
# @return [String]
|
246
|
+
# Resource name of the ProductSet to get.
|
247
|
+
#
|
248
|
+
# Format is:
|
249
|
+
# `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID`
|
250
|
+
class GetProductSetRequest; end
|
251
|
+
|
252
|
+
# Request message for the `UpdateProductSet` method.
|
253
|
+
# @!attribute [rw] product_set
|
254
|
+
# @return [Google::Cloud::Vision::V1p3beta1::ProductSet]
|
255
|
+
# The ProductSet resource which replaces the one on the server.
|
256
|
+
# @!attribute [rw] update_mask
|
257
|
+
# @return [Google::Protobuf::FieldMask]
|
258
|
+
# The {Google::Protobuf::FieldMask FieldMask} that specifies which fields to
|
259
|
+
# update.
|
260
|
+
# If update_mask isn't specified, all mutable fields are to be updated.
|
261
|
+
# Valid mask path is `display_name`.
|
262
|
+
class UpdateProductSetRequest; end
|
263
|
+
|
264
|
+
# Request message for the `DeleteProductSet` method.
|
265
|
+
# @!attribute [rw] name
|
266
|
+
# @return [String]
|
267
|
+
# Resource name of the ProductSet to delete.
|
268
|
+
#
|
269
|
+
# Format is:
|
270
|
+
# `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
|
271
|
+
class DeleteProductSetRequest; end
|
272
|
+
|
273
|
+
# Request message for the `CreateReferenceImage` method.
|
274
|
+
# @!attribute [rw] parent
|
275
|
+
# @return [String]
|
276
|
+
# Resource name of the product in which to create the reference image.
|
277
|
+
#
|
278
|
+
# Format is
|
279
|
+
# `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
|
280
|
+
# @!attribute [rw] reference_image
|
281
|
+
# @return [Google::Cloud::Vision::V1p3beta1::ReferenceImage]
|
282
|
+
# The reference image to create.
|
283
|
+
# If an image ID is specified, it is ignored.
|
284
|
+
# @!attribute [rw] reference_image_id
|
285
|
+
# @return [String]
|
286
|
+
# A user-supplied resource id for the ReferenceImage to be added. If set,
|
287
|
+
# the server will attempt to use this value as the resource id. If it is
|
288
|
+
# already in use, an error is returned with code ALREADY_EXISTS. Must be at
|
289
|
+
# most 128 characters long. It cannot contain the character `/`.
|
290
|
+
class CreateReferenceImageRequest; end
|
291
|
+
|
292
|
+
# Request message for the `ListReferenceImages` method.
|
293
|
+
# @!attribute [rw] parent
|
294
|
+
# @return [String]
|
295
|
+
# Resource name of the product containing the reference images.
|
296
|
+
#
|
297
|
+
# Format is
|
298
|
+
# `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
|
299
|
+
# @!attribute [rw] page_size
|
300
|
+
# @return [Integer]
|
301
|
+
# The maximum number of items to return. Default 10, maximum 100.
|
302
|
+
# @!attribute [rw] page_token
|
303
|
+
# @return [String]
|
304
|
+
# A token identifying a page of results to be returned. This is the value
|
305
|
+
# of `nextPageToken` returned in a previous reference image list request.
|
306
|
+
#
|
307
|
+
# Defaults to the first page if not specified.
|
308
|
+
class ListReferenceImagesRequest; end
|
309
|
+
|
310
|
+
# Response message for the `ListReferenceImages` method.
|
311
|
+
# @!attribute [rw] reference_images
|
312
|
+
# @return [Array<Google::Cloud::Vision::V1p3beta1::ReferenceImage>]
|
313
|
+
# The list of reference images.
|
314
|
+
# @!attribute [rw] page_size
|
315
|
+
# @return [Integer]
|
316
|
+
# The maximum number of items to return. Default 10, maximum 100.
|
317
|
+
# @!attribute [rw] next_page_token
|
318
|
+
# @return [String]
|
319
|
+
# The next_page_token returned from a previous List request, if any.
|
320
|
+
class ListReferenceImagesResponse; end
|
321
|
+
|
322
|
+
# Request message for the `GetReferenceImage` method.
|
323
|
+
# @!attribute [rw] name
|
324
|
+
# @return [String]
|
325
|
+
# The resource name of the ReferenceImage to get.
|
326
|
+
#
|
327
|
+
# Format is:
|
328
|
+
#
|
329
|
+
# `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
|
330
|
+
class GetReferenceImageRequest; end
|
331
|
+
|
332
|
+
# Request message for the `DeleteReferenceImage` method.
|
333
|
+
# @!attribute [rw] name
|
334
|
+
# @return [String]
|
335
|
+
# The resource name of the reference image to delete.
|
336
|
+
#
|
337
|
+
# Format is:
|
338
|
+
#
|
339
|
+
# `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`
|
340
|
+
class DeleteReferenceImageRequest; end
|
341
|
+
|
342
|
+
# Request message for the `AddProductToProductSet` method.
|
343
|
+
# @!attribute [rw] name
|
344
|
+
# @return [String]
|
345
|
+
# The resource name for the ProductSet to modify.
|
346
|
+
#
|
347
|
+
# Format is:
|
348
|
+
# `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
|
349
|
+
# @!attribute [rw] product
|
350
|
+
# @return [String]
|
351
|
+
# The resource name for the Product to be added to this ProductSet.
|
352
|
+
#
|
353
|
+
# Format is:
|
354
|
+
# `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
|
355
|
+
class AddProductToProductSetRequest; end
|
356
|
+
|
357
|
+
# Request message for the `RemoveProductFromProductSet` method.
|
358
|
+
# @!attribute [rw] name
|
359
|
+
# @return [String]
|
360
|
+
# The resource name for the ProductSet to modify.
|
361
|
+
#
|
362
|
+
# Format is:
|
363
|
+
# `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
|
364
|
+
# @!attribute [rw] product
|
365
|
+
# @return [String]
|
366
|
+
# The resource name for the Product to be removed from this ProductSet.
|
367
|
+
#
|
368
|
+
# Format is:
|
369
|
+
# `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
|
370
|
+
class RemoveProductFromProductSetRequest; end
|
371
|
+
|
372
|
+
# Request message for the `ListProductsInProductSet` method.
|
373
|
+
# @!attribute [rw] name
|
374
|
+
# @return [String]
|
375
|
+
# The ProductSet resource for which to retrieve Products.
|
376
|
+
#
|
377
|
+
# Format is:
|
378
|
+
# `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
|
379
|
+
# @!attribute [rw] page_size
|
380
|
+
# @return [Integer]
|
381
|
+
# The maximum number of items to return. Default 10, maximum 100.
|
382
|
+
# @!attribute [rw] page_token
|
383
|
+
# @return [String]
|
384
|
+
# The next_page_token returned from a previous List request, if any.
|
385
|
+
class ListProductsInProductSetRequest; end
|
386
|
+
|
387
|
+
# Response message for the `ListProductsInProductSet` method.
|
388
|
+
# @!attribute [rw] products
|
389
|
+
# @return [Array<Google::Cloud::Vision::V1p3beta1::Product>]
|
390
|
+
# The list of Products.
|
391
|
+
# @!attribute [rw] next_page_token
|
392
|
+
# @return [String]
|
393
|
+
# Token to retrieve the next page of results, or empty if there are no more
|
394
|
+
# results in the list.
|
395
|
+
class ListProductsInProductSetResponse; end
|
396
|
+
|
397
|
+
# The Google Cloud Storage location for a csv file which preserves a list of
|
398
|
+
# ImportProductSetRequests in each line.
|
399
|
+
# @!attribute [rw] csv_file_uri
|
400
|
+
# @return [String]
|
401
|
+
# The Google Cloud Storage URI of the input csv file.
|
402
|
+
#
|
403
|
+
# The URI must start with gs://
|
404
|
+
#
|
405
|
+
# The format of the input csv file should be one image per line.
|
406
|
+
# In each line, there are 6 columns.
|
407
|
+
# 1. image_uri
|
408
|
+
# 2, image_id
|
409
|
+
# 3. product_set_id
|
410
|
+
# 4. product_id
|
411
|
+
# 5, product_category
|
412
|
+
# 6, product_display_name
|
413
|
+
# 7, labels
|
414
|
+
# 8. bounding_poly
|
415
|
+
#
|
416
|
+
# Columns 1, 3, 4, and 5 are required, other columns are optional. A new
|
417
|
+
# ProductSet/Product with the same id will be created on the fly
|
418
|
+
# if the ProductSet/Product specified by product_set_id/product_id does not
|
419
|
+
# exist.
|
420
|
+
#
|
421
|
+
# The image_id field is optional but has to be unique if provided. If it is
|
422
|
+
# empty, we will automatically assign an unique id to the image.
|
423
|
+
#
|
424
|
+
# The product_display_name field is optional. If it is empty, a space (" ")
|
425
|
+
# is used as the place holder for the product display_name, which can
|
426
|
+
# be updated later through the realtime API.
|
427
|
+
#
|
428
|
+
# If the Product with product_id already exists, the fields
|
429
|
+
# product_display_name, product_category and labels are ignored.
|
430
|
+
#
|
431
|
+
# If a Product doesn't exist and needs to be created on the fly, the
|
432
|
+
# product_display_name field refers to {Google::Cloud::Vision::V1p3beta1::Product#display_name Product#display_name}, the
|
433
|
+
# product_category field refers to {Google::Cloud::Vision::V1p3beta1::Product#product_category Product#product_category}, and the
|
434
|
+
# labels field refers to {Product#labels}.
|
435
|
+
#
|
436
|
+
# Labels (optional) should be a line containing a list of comma-separated
|
437
|
+
# key-value pairs, with the format
|
438
|
+
# "key_1=value_1,key_2=value_2,...,key_n=value_n".
|
439
|
+
#
|
440
|
+
# The bounding_poly (optional) field is used to identify one region of
|
441
|
+
# interest from the image in the same manner as CreateReferenceImage. If no
|
442
|
+
# bounding_poly is specified, the system will try to detect regions of
|
443
|
+
# interest automatically.
|
444
|
+
#
|
445
|
+
# Note that the pipeline will resize the image if the image resolution is too
|
446
|
+
# large to process (above 20MP).
|
447
|
+
#
|
448
|
+
# Also note that at most one bounding_poly is allowed per line. If the image
|
449
|
+
# contains multiple regions of interest, the csv should contain one line per
|
450
|
+
# region of interest.
|
451
|
+
#
|
452
|
+
# The bounding_poly column should contain an even number of comma-separated
|
453
|
+
# numbers, with the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Nonnegative
|
454
|
+
# integers should be used for absolute bounding polygons, and float values
|
455
|
+
# in [0, 1] should be used for normalized bounding polygons.
|
456
|
+
class ImportProductSetsGcsSource; end
|
457
|
+
|
458
|
+
# The input content for the `ImportProductSets` method.
|
459
|
+
# @!attribute [rw] gcs_source
|
460
|
+
# @return [Google::Cloud::Vision::V1p3beta1::ImportProductSetsGcsSource]
|
461
|
+
# The Google Cloud Storage location for a csv file which preserves a list
|
462
|
+
# of ImportProductSetRequests in each line.
|
463
|
+
class ImportProductSetsInputConfig; end
|
464
|
+
|
465
|
+
# Request message for the `ImportProductSets` method.
|
466
|
+
# @!attribute [rw] parent
|
467
|
+
# @return [String]
|
468
|
+
# The project in which the ProductSets should be imported.
|
469
|
+
#
|
470
|
+
# Format is `projects/PROJECT_ID/locations/LOC_ID`.
|
471
|
+
# @!attribute [rw] input_config
|
472
|
+
# @return [Google::Cloud::Vision::V1p3beta1::ImportProductSetsInputConfig]
|
473
|
+
# The input content for the list of requests.
|
474
|
+
class ImportProductSetsRequest; end
|
475
|
+
|
476
|
+
# Response message for the `ImportProductSets` method.
|
477
|
+
#
|
478
|
+
# This message is returned by the
|
479
|
+
# {Google::Longrunning::Operations::GetOperation} method in the returned
|
480
|
+
# {Google::Longrunning::Operation#response} field.
|
481
|
+
# @!attribute [rw] reference_images
|
482
|
+
# @return [Array<Google::Cloud::Vision::V1p3beta1::ReferenceImage>]
|
483
|
+
# The list of reference_images that are imported successfully.
|
484
|
+
# @!attribute [rw] statuses
|
485
|
+
# @return [Array<Google::Rpc::Status>]
|
486
|
+
# The rpc status for each ImportProductSet request, including both successes
|
487
|
+
# and errors.
|
488
|
+
#
|
489
|
+
# The number of statuses here matches the number of lines in the csv file,
|
490
|
+
# and statuses[i] stores the success or failure status of processing the i-th
|
491
|
+
# line of the csv, starting from line 0.
|
492
|
+
class ImportProductSetsResponse; end
|
493
|
+
|
494
|
+
# Metadata for the batch operations such as the current state.
|
495
|
+
#
|
496
|
+
# This is included in the `metadata` field of the `Operation` returned by the
|
497
|
+
# `GetOperation` call of the `google::longrunning::Operations` service.
|
498
|
+
# @!attribute [rw] state
|
499
|
+
# @return [Google::Cloud::Vision::V1p3beta1::BatchOperationMetadata::State]
|
500
|
+
# The current state of the batch operation.
|
501
|
+
# @!attribute [rw] submit_time
|
502
|
+
# @return [Google::Protobuf::Timestamp]
|
503
|
+
# The time when the batch request was submitted to the server.
|
504
|
+
# @!attribute [rw] end_time
|
505
|
+
# @return [Google::Protobuf::Timestamp]
|
506
|
+
# The time when the batch request is finished and
|
507
|
+
# {Google::Longrunning::Operation#done} is set to true.
|
508
|
+
class BatchOperationMetadata
|
509
|
+
# Enumerates the possible states that the batch request can be in.
|
510
|
+
module State
|
511
|
+
# Invalid.
|
512
|
+
STATE_UNSPECIFIED = 0
|
513
|
+
|
514
|
+
# Request is actively being processed.
|
515
|
+
PROCESSING = 1
|
516
|
+
|
517
|
+
# The request is done and at least one item has been successfully
|
518
|
+
# processed.
|
519
|
+
SUCCESSFUL = 2
|
520
|
+
|
521
|
+
# The request is done and no item has been successfully processed.
|
522
|
+
FAILED = 3
|
523
|
+
|
524
|
+
# The request is done after the longrunning.Operations.CancelOperation has
|
525
|
+
# been called by the user. Any records that were processed before the
|
526
|
+
# cancel command are output as specified in the request.
|
527
|
+
CANCELLED = 4
|
528
|
+
end
|
529
|
+
end
|
530
|
+
end
|
531
|
+
end
|
532
|
+
end
|
533
|
+
end
|