google-cloud-vision-v1 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +169 -0
- data/LICENSE.md +203 -0
- data/README.md +24 -0
- data/lib/google-cloud-vision-v1.rb +1 -0
- data/lib/google/cloud/common_resources_pb.rb +15 -0
- data/lib/google/cloud/vision/v1.rb +20 -0
- data/lib/google/cloud/vision/v1/geometry_pb.rb +40 -0
- data/lib/google/cloud/vision/v1/image_annotator.rb +21 -0
- data/lib/google/cloud/vision/v1/image_annotator/client.rb +682 -0
- data/lib/google/cloud/vision/v1/image_annotator/credentials.rb +52 -0
- data/lib/google/cloud/vision/v1/image_annotator/helpers.rb +1228 -0
- data/lib/google/cloud/vision/v1/image_annotator/operations.rb +558 -0
- data/lib/google/cloud/vision/v1/image_annotator/paths.rb +52 -0
- data/lib/google/cloud/vision/v1/image_annotator_pb.rb +345 -0
- data/lib/google/cloud/vision/v1/image_annotator_services_pb.rb +73 -0
- data/lib/google/cloud/vision/v1/product_search.rb +21 -0
- data/lib/google/cloud/vision/v1/product_search/client.rb +2134 -0
- data/lib/google/cloud/vision/v1/product_search/credentials.rb +52 -0
- data/lib/google/cloud/vision/v1/product_search/operations.rb +558 -0
- data/lib/google/cloud/vision/v1/product_search/paths.rb +109 -0
- data/lib/google/cloud/vision/v1/product_search_pb.rb +55 -0
- data/lib/google/cloud/vision/v1/product_search_service_pb.rb +208 -0
- data/lib/google/cloud/vision/v1/product_search_service_services_pb.rb +232 -0
- data/lib/google/cloud/vision/v1/text_annotation_pb.rb +95 -0
- data/lib/google/cloud/vision/v1/version.rb +28 -0
- data/lib/google/cloud/vision/v1/web_detection_pb.rb +52 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/field_behavior.rb +59 -0
- data/proto_docs/google/api/resource.rb +247 -0
- data/proto_docs/google/cloud/vision/v1/geometry.rb +82 -0
- data/proto_docs/google/cloud/vision/v1/image_annotator.rb +1044 -0
- data/proto_docs/google/cloud/vision/v1/product_search.rb +134 -0
- data/proto_docs/google/cloud/vision/v1/product_search_service.rb +669 -0
- data/proto_docs/google/cloud/vision/v1/text_annotation.rb +285 -0
- data/proto_docs/google/cloud/vision/v1/web_detection.rb +121 -0
- data/proto_docs/google/longrunning/operations.rb +150 -0
- data/proto_docs/google/protobuf/any.rb +137 -0
- data/proto_docs/google/protobuf/empty.rb +36 -0
- data/proto_docs/google/protobuf/field_mask.rb +237 -0
- data/proto_docs/google/protobuf/timestamp.rb +116 -0
- data/proto_docs/google/protobuf/wrappers.rb +121 -0
- data/proto_docs/google/rpc/status.rb +46 -0
- data/proto_docs/google/type/color.rb +168 -0
- data/proto_docs/google/type/latlng.rb +38 -0
- metadata +201 -0
@@ -0,0 +1,109 @@
|
|
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
|
+
module ProductSearch
|
25
|
+
# Path helper methods for the ProductSearch API.
|
26
|
+
module Paths
|
27
|
+
##
|
28
|
+
# Create a fully-qualified Location resource string.
|
29
|
+
#
|
30
|
+
# The resource will be in the following format:
|
31
|
+
#
|
32
|
+
# `projects/{project}/locations/{location}`
|
33
|
+
#
|
34
|
+
# @param project [String]
|
35
|
+
# @param location [String]
|
36
|
+
#
|
37
|
+
# @return [String]
|
38
|
+
def location_path project:, location:
|
39
|
+
raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
40
|
+
|
41
|
+
"projects/#{project}/locations/#{location}"
|
42
|
+
end
|
43
|
+
|
44
|
+
##
|
45
|
+
# Create a fully-qualified Product resource string.
|
46
|
+
#
|
47
|
+
# The resource will be in the following format:
|
48
|
+
#
|
49
|
+
# `projects/{project}/locations/{location}/products/{product}`
|
50
|
+
#
|
51
|
+
# @param project [String]
|
52
|
+
# @param location [String]
|
53
|
+
# @param product [String]
|
54
|
+
#
|
55
|
+
# @return [String]
|
56
|
+
def product_path project:, location:, product:
|
57
|
+
raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
58
|
+
raise ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
59
|
+
|
60
|
+
"projects/#{project}/locations/#{location}/products/#{product}"
|
61
|
+
end
|
62
|
+
|
63
|
+
##
|
64
|
+
# Create a fully-qualified ProductSet resource string.
|
65
|
+
#
|
66
|
+
# The resource will be in the following format:
|
67
|
+
#
|
68
|
+
# `projects/{project}/locations/{location}/productSets/{product_set}`
|
69
|
+
#
|
70
|
+
# @param project [String]
|
71
|
+
# @param location [String]
|
72
|
+
# @param product_set [String]
|
73
|
+
#
|
74
|
+
# @return [String]
|
75
|
+
def product_set_path project:, location:, product_set:
|
76
|
+
raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
77
|
+
raise ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
78
|
+
|
79
|
+
"projects/#{project}/locations/#{location}/productSets/#{product_set}"
|
80
|
+
end
|
81
|
+
|
82
|
+
##
|
83
|
+
# Create a fully-qualified ReferenceImage resource string.
|
84
|
+
#
|
85
|
+
# The resource will be in the following format:
|
86
|
+
#
|
87
|
+
# `projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}`
|
88
|
+
#
|
89
|
+
# @param project [String]
|
90
|
+
# @param location [String]
|
91
|
+
# @param product [String]
|
92
|
+
# @param reference_image [String]
|
93
|
+
#
|
94
|
+
# @return [String]
|
95
|
+
def reference_image_path project:, location:, product:, reference_image:
|
96
|
+
raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
97
|
+
raise ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
98
|
+
raise ArgumentError, "product cannot contain /" if product.to_s.include? "/"
|
99
|
+
|
100
|
+
"projects/#{project}/locations/#{location}/products/#{product}/referenceImages/#{reference_image}"
|
101
|
+
end
|
102
|
+
|
103
|
+
extend self
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: google/cloud/vision/v1/product_search.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require 'google/cloud/vision/v1/geometry_pb'
|
7
|
+
require 'google/cloud/vision/v1/product_search_service_pb'
|
8
|
+
require 'google/protobuf/timestamp_pb'
|
9
|
+
require 'google/api/annotations_pb'
|
10
|
+
require 'google/api/resource_pb'
|
11
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
12
|
+
add_file("google/cloud/vision/v1/product_search.proto", :syntax => :proto3) do
|
13
|
+
add_message "google.cloud.vision.v1.ProductSearchParams" do
|
14
|
+
optional :bounding_poly, :message, 9, "google.cloud.vision.v1.BoundingPoly"
|
15
|
+
optional :product_set, :string, 6
|
16
|
+
repeated :product_categories, :string, 7
|
17
|
+
optional :filter, :string, 8
|
18
|
+
end
|
19
|
+
add_message "google.cloud.vision.v1.ProductSearchResults" do
|
20
|
+
optional :index_time, :message, 2, "google.protobuf.Timestamp"
|
21
|
+
repeated :results, :message, 5, "google.cloud.vision.v1.ProductSearchResults.Result"
|
22
|
+
repeated :product_grouped_results, :message, 6, "google.cloud.vision.v1.ProductSearchResults.GroupedResult"
|
23
|
+
end
|
24
|
+
add_message "google.cloud.vision.v1.ProductSearchResults.Result" do
|
25
|
+
optional :product, :message, 1, "google.cloud.vision.v1.Product"
|
26
|
+
optional :score, :float, 2
|
27
|
+
optional :image, :string, 3
|
28
|
+
end
|
29
|
+
add_message "google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation" do
|
30
|
+
optional :mid, :string, 1
|
31
|
+
optional :language_code, :string, 2
|
32
|
+
optional :name, :string, 3
|
33
|
+
optional :score, :float, 4
|
34
|
+
end
|
35
|
+
add_message "google.cloud.vision.v1.ProductSearchResults.GroupedResult" do
|
36
|
+
optional :bounding_poly, :message, 1, "google.cloud.vision.v1.BoundingPoly"
|
37
|
+
repeated :results, :message, 2, "google.cloud.vision.v1.ProductSearchResults.Result"
|
38
|
+
repeated :object_annotations, :message, 3, "google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
module Google
|
44
|
+
module Cloud
|
45
|
+
module Vision
|
46
|
+
module V1
|
47
|
+
ProductSearchParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ProductSearchParams").msgclass
|
48
|
+
ProductSearchResults = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ProductSearchResults").msgclass
|
49
|
+
ProductSearchResults::Result = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ProductSearchResults.Result").msgclass
|
50
|
+
ProductSearchResults::ObjectAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation").msgclass
|
51
|
+
ProductSearchResults::GroupedResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ProductSearchResults.GroupedResult").msgclass
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,208 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: google/cloud/vision/v1/product_search_service.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require 'google/api/annotations_pb'
|
7
|
+
require 'google/api/client_pb'
|
8
|
+
require 'google/api/field_behavior_pb'
|
9
|
+
require 'google/api/resource_pb'
|
10
|
+
require 'google/cloud/vision/v1/geometry_pb'
|
11
|
+
require 'google/longrunning/operations_pb'
|
12
|
+
require 'google/protobuf/empty_pb'
|
13
|
+
require 'google/protobuf/field_mask_pb'
|
14
|
+
require 'google/protobuf/timestamp_pb'
|
15
|
+
require 'google/rpc/status_pb'
|
16
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
17
|
+
add_file("google/cloud/vision/v1/product_search_service.proto", :syntax => :proto3) do
|
18
|
+
add_message "google.cloud.vision.v1.Product" do
|
19
|
+
optional :name, :string, 1
|
20
|
+
optional :display_name, :string, 2
|
21
|
+
optional :description, :string, 3
|
22
|
+
optional :product_category, :string, 4
|
23
|
+
repeated :product_labels, :message, 5, "google.cloud.vision.v1.Product.KeyValue"
|
24
|
+
end
|
25
|
+
add_message "google.cloud.vision.v1.Product.KeyValue" do
|
26
|
+
optional :key, :string, 1
|
27
|
+
optional :value, :string, 2
|
28
|
+
end
|
29
|
+
add_message "google.cloud.vision.v1.ProductSet" do
|
30
|
+
optional :name, :string, 1
|
31
|
+
optional :display_name, :string, 2
|
32
|
+
optional :index_time, :message, 3, "google.protobuf.Timestamp"
|
33
|
+
optional :index_error, :message, 4, "google.rpc.Status"
|
34
|
+
end
|
35
|
+
add_message "google.cloud.vision.v1.ReferenceImage" do
|
36
|
+
optional :name, :string, 1
|
37
|
+
optional :uri, :string, 2
|
38
|
+
repeated :bounding_polys, :message, 3, "google.cloud.vision.v1.BoundingPoly"
|
39
|
+
end
|
40
|
+
add_message "google.cloud.vision.v1.CreateProductRequest" do
|
41
|
+
optional :parent, :string, 1
|
42
|
+
optional :product, :message, 2, "google.cloud.vision.v1.Product"
|
43
|
+
optional :product_id, :string, 3
|
44
|
+
end
|
45
|
+
add_message "google.cloud.vision.v1.ListProductsRequest" do
|
46
|
+
optional :parent, :string, 1
|
47
|
+
optional :page_size, :int32, 2
|
48
|
+
optional :page_token, :string, 3
|
49
|
+
end
|
50
|
+
add_message "google.cloud.vision.v1.ListProductsResponse" do
|
51
|
+
repeated :products, :message, 1, "google.cloud.vision.v1.Product"
|
52
|
+
optional :next_page_token, :string, 2
|
53
|
+
end
|
54
|
+
add_message "google.cloud.vision.v1.GetProductRequest" do
|
55
|
+
optional :name, :string, 1
|
56
|
+
end
|
57
|
+
add_message "google.cloud.vision.v1.UpdateProductRequest" do
|
58
|
+
optional :product, :message, 1, "google.cloud.vision.v1.Product"
|
59
|
+
optional :update_mask, :message, 2, "google.protobuf.FieldMask"
|
60
|
+
end
|
61
|
+
add_message "google.cloud.vision.v1.DeleteProductRequest" do
|
62
|
+
optional :name, :string, 1
|
63
|
+
end
|
64
|
+
add_message "google.cloud.vision.v1.CreateProductSetRequest" do
|
65
|
+
optional :parent, :string, 1
|
66
|
+
optional :product_set, :message, 2, "google.cloud.vision.v1.ProductSet"
|
67
|
+
optional :product_set_id, :string, 3
|
68
|
+
end
|
69
|
+
add_message "google.cloud.vision.v1.ListProductSetsRequest" do
|
70
|
+
optional :parent, :string, 1
|
71
|
+
optional :page_size, :int32, 2
|
72
|
+
optional :page_token, :string, 3
|
73
|
+
end
|
74
|
+
add_message "google.cloud.vision.v1.ListProductSetsResponse" do
|
75
|
+
repeated :product_sets, :message, 1, "google.cloud.vision.v1.ProductSet"
|
76
|
+
optional :next_page_token, :string, 2
|
77
|
+
end
|
78
|
+
add_message "google.cloud.vision.v1.GetProductSetRequest" do
|
79
|
+
optional :name, :string, 1
|
80
|
+
end
|
81
|
+
add_message "google.cloud.vision.v1.UpdateProductSetRequest" do
|
82
|
+
optional :product_set, :message, 1, "google.cloud.vision.v1.ProductSet"
|
83
|
+
optional :update_mask, :message, 2, "google.protobuf.FieldMask"
|
84
|
+
end
|
85
|
+
add_message "google.cloud.vision.v1.DeleteProductSetRequest" do
|
86
|
+
optional :name, :string, 1
|
87
|
+
end
|
88
|
+
add_message "google.cloud.vision.v1.CreateReferenceImageRequest" do
|
89
|
+
optional :parent, :string, 1
|
90
|
+
optional :reference_image, :message, 2, "google.cloud.vision.v1.ReferenceImage"
|
91
|
+
optional :reference_image_id, :string, 3
|
92
|
+
end
|
93
|
+
add_message "google.cloud.vision.v1.ListReferenceImagesRequest" do
|
94
|
+
optional :parent, :string, 1
|
95
|
+
optional :page_size, :int32, 2
|
96
|
+
optional :page_token, :string, 3
|
97
|
+
end
|
98
|
+
add_message "google.cloud.vision.v1.ListReferenceImagesResponse" do
|
99
|
+
repeated :reference_images, :message, 1, "google.cloud.vision.v1.ReferenceImage"
|
100
|
+
optional :page_size, :int32, 2
|
101
|
+
optional :next_page_token, :string, 3
|
102
|
+
end
|
103
|
+
add_message "google.cloud.vision.v1.GetReferenceImageRequest" do
|
104
|
+
optional :name, :string, 1
|
105
|
+
end
|
106
|
+
add_message "google.cloud.vision.v1.DeleteReferenceImageRequest" do
|
107
|
+
optional :name, :string, 1
|
108
|
+
end
|
109
|
+
add_message "google.cloud.vision.v1.AddProductToProductSetRequest" do
|
110
|
+
optional :name, :string, 1
|
111
|
+
optional :product, :string, 2
|
112
|
+
end
|
113
|
+
add_message "google.cloud.vision.v1.RemoveProductFromProductSetRequest" do
|
114
|
+
optional :name, :string, 1
|
115
|
+
optional :product, :string, 2
|
116
|
+
end
|
117
|
+
add_message "google.cloud.vision.v1.ListProductsInProductSetRequest" do
|
118
|
+
optional :name, :string, 1
|
119
|
+
optional :page_size, :int32, 2
|
120
|
+
optional :page_token, :string, 3
|
121
|
+
end
|
122
|
+
add_message "google.cloud.vision.v1.ListProductsInProductSetResponse" do
|
123
|
+
repeated :products, :message, 1, "google.cloud.vision.v1.Product"
|
124
|
+
optional :next_page_token, :string, 2
|
125
|
+
end
|
126
|
+
add_message "google.cloud.vision.v1.ImportProductSetsGcsSource" do
|
127
|
+
optional :csv_file_uri, :string, 1
|
128
|
+
end
|
129
|
+
add_message "google.cloud.vision.v1.ImportProductSetsInputConfig" do
|
130
|
+
oneof :source do
|
131
|
+
optional :gcs_source, :message, 1, "google.cloud.vision.v1.ImportProductSetsGcsSource"
|
132
|
+
end
|
133
|
+
end
|
134
|
+
add_message "google.cloud.vision.v1.ImportProductSetsRequest" do
|
135
|
+
optional :parent, :string, 1
|
136
|
+
optional :input_config, :message, 2, "google.cloud.vision.v1.ImportProductSetsInputConfig"
|
137
|
+
end
|
138
|
+
add_message "google.cloud.vision.v1.ImportProductSetsResponse" do
|
139
|
+
repeated :reference_images, :message, 1, "google.cloud.vision.v1.ReferenceImage"
|
140
|
+
repeated :statuses, :message, 2, "google.rpc.Status"
|
141
|
+
end
|
142
|
+
add_message "google.cloud.vision.v1.BatchOperationMetadata" do
|
143
|
+
optional :state, :enum, 1, "google.cloud.vision.v1.BatchOperationMetadata.State"
|
144
|
+
optional :submit_time, :message, 2, "google.protobuf.Timestamp"
|
145
|
+
optional :end_time, :message, 3, "google.protobuf.Timestamp"
|
146
|
+
end
|
147
|
+
add_enum "google.cloud.vision.v1.BatchOperationMetadata.State" do
|
148
|
+
value :STATE_UNSPECIFIED, 0
|
149
|
+
value :PROCESSING, 1
|
150
|
+
value :SUCCESSFUL, 2
|
151
|
+
value :FAILED, 3
|
152
|
+
value :CANCELLED, 4
|
153
|
+
end
|
154
|
+
add_message "google.cloud.vision.v1.ProductSetPurgeConfig" do
|
155
|
+
optional :product_set_id, :string, 1
|
156
|
+
end
|
157
|
+
add_message "google.cloud.vision.v1.PurgeProductsRequest" do
|
158
|
+
optional :parent, :string, 1
|
159
|
+
optional :force, :bool, 4
|
160
|
+
oneof :target do
|
161
|
+
optional :product_set_purge_config, :message, 2, "google.cloud.vision.v1.ProductSetPurgeConfig"
|
162
|
+
optional :delete_orphan_products, :bool, 3
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
module Google
|
169
|
+
module Cloud
|
170
|
+
module Vision
|
171
|
+
module V1
|
172
|
+
Product = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.Product").msgclass
|
173
|
+
Product::KeyValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.Product.KeyValue").msgclass
|
174
|
+
ProductSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ProductSet").msgclass
|
175
|
+
ReferenceImage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ReferenceImage").msgclass
|
176
|
+
CreateProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.CreateProductRequest").msgclass
|
177
|
+
ListProductsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ListProductsRequest").msgclass
|
178
|
+
ListProductsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ListProductsResponse").msgclass
|
179
|
+
GetProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.GetProductRequest").msgclass
|
180
|
+
UpdateProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.UpdateProductRequest").msgclass
|
181
|
+
DeleteProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.DeleteProductRequest").msgclass
|
182
|
+
CreateProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.CreateProductSetRequest").msgclass
|
183
|
+
ListProductSetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ListProductSetsRequest").msgclass
|
184
|
+
ListProductSetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ListProductSetsResponse").msgclass
|
185
|
+
GetProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.GetProductSetRequest").msgclass
|
186
|
+
UpdateProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.UpdateProductSetRequest").msgclass
|
187
|
+
DeleteProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.DeleteProductSetRequest").msgclass
|
188
|
+
CreateReferenceImageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.CreateReferenceImageRequest").msgclass
|
189
|
+
ListReferenceImagesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ListReferenceImagesRequest").msgclass
|
190
|
+
ListReferenceImagesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ListReferenceImagesResponse").msgclass
|
191
|
+
GetReferenceImageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.GetReferenceImageRequest").msgclass
|
192
|
+
DeleteReferenceImageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.DeleteReferenceImageRequest").msgclass
|
193
|
+
AddProductToProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.AddProductToProductSetRequest").msgclass
|
194
|
+
RemoveProductFromProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.RemoveProductFromProductSetRequest").msgclass
|
195
|
+
ListProductsInProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ListProductsInProductSetRequest").msgclass
|
196
|
+
ListProductsInProductSetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ListProductsInProductSetResponse").msgclass
|
197
|
+
ImportProductSetsGcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ImportProductSetsGcsSource").msgclass
|
198
|
+
ImportProductSetsInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ImportProductSetsInputConfig").msgclass
|
199
|
+
ImportProductSetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ImportProductSetsRequest").msgclass
|
200
|
+
ImportProductSetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ImportProductSetsResponse").msgclass
|
201
|
+
BatchOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.BatchOperationMetadata").msgclass
|
202
|
+
BatchOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.BatchOperationMetadata.State").enummodule
|
203
|
+
ProductSetPurgeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ProductSetPurgeConfig").msgclass
|
204
|
+
PurgeProductsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.PurgeProductsRequest").msgclass
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|
@@ -0,0 +1,232 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: google/cloud/vision/v1/product_search_service.proto for package 'google.cloud.vision.v1'
|
3
|
+
# Original file comments:
|
4
|
+
# Copyright 2019 Google LLC.
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
#
|
19
|
+
|
20
|
+
require 'grpc'
|
21
|
+
require 'google/cloud/vision/v1/product_search_service_pb'
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Cloud
|
25
|
+
module Vision
|
26
|
+
module V1
|
27
|
+
module ProductSearch
|
28
|
+
# Manages Products and ProductSets of reference images for use in product
|
29
|
+
# search. It uses the following resource model:
|
30
|
+
#
|
31
|
+
# - The API has a collection of [ProductSet][google.cloud.vision.v1.ProductSet] resources, named
|
32
|
+
# `projects/*/locations/*/productSets/*`, which acts as a way to put different
|
33
|
+
# products into groups to limit identification.
|
34
|
+
#
|
35
|
+
# In parallel,
|
36
|
+
#
|
37
|
+
# - The API has a collection of [Product][google.cloud.vision.v1.Product] resources, named
|
38
|
+
# `projects/*/locations/*/products/*`
|
39
|
+
#
|
40
|
+
# - Each [Product][google.cloud.vision.v1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1.ReferenceImage] resources, named
|
41
|
+
# `projects/*/locations/*/products/*/referenceImages/*`
|
42
|
+
class Service
|
43
|
+
|
44
|
+
include GRPC::GenericService
|
45
|
+
|
46
|
+
self.marshal_class_method = :encode
|
47
|
+
self.unmarshal_class_method = :decode
|
48
|
+
self.service_name = 'google.cloud.vision.v1.ProductSearch'
|
49
|
+
|
50
|
+
# Creates and returns a new ProductSet resource.
|
51
|
+
#
|
52
|
+
# Possible errors:
|
53
|
+
#
|
54
|
+
# * Returns INVALID_ARGUMENT if display_name is missing, or is longer than
|
55
|
+
# 4096 characters.
|
56
|
+
rpc :CreateProductSet, CreateProductSetRequest, ProductSet
|
57
|
+
# Lists ProductSets in an unspecified order.
|
58
|
+
#
|
59
|
+
# Possible errors:
|
60
|
+
#
|
61
|
+
# * Returns INVALID_ARGUMENT if page_size is greater than 100, or less
|
62
|
+
# than 1.
|
63
|
+
rpc :ListProductSets, ListProductSetsRequest, ListProductSetsResponse
|
64
|
+
# Gets information associated with a ProductSet.
|
65
|
+
#
|
66
|
+
# Possible errors:
|
67
|
+
#
|
68
|
+
# * Returns NOT_FOUND if the ProductSet does not exist.
|
69
|
+
rpc :GetProductSet, GetProductSetRequest, ProductSet
|
70
|
+
# Makes changes to a ProductSet resource.
|
71
|
+
# Only display_name can be updated currently.
|
72
|
+
#
|
73
|
+
# Possible errors:
|
74
|
+
#
|
75
|
+
# * Returns NOT_FOUND if the ProductSet does not exist.
|
76
|
+
# * Returns INVALID_ARGUMENT if display_name is present in update_mask but
|
77
|
+
# missing from the request or longer than 4096 characters.
|
78
|
+
rpc :UpdateProductSet, UpdateProductSetRequest, ProductSet
|
79
|
+
# Permanently deletes a ProductSet. Products and ReferenceImages in the
|
80
|
+
# ProductSet are not deleted.
|
81
|
+
#
|
82
|
+
# The actual image files are not deleted from Google Cloud Storage.
|
83
|
+
rpc :DeleteProductSet, DeleteProductSetRequest, Google::Protobuf::Empty
|
84
|
+
# Creates and returns a new product resource.
|
85
|
+
#
|
86
|
+
# Possible errors:
|
87
|
+
#
|
88
|
+
# * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096
|
89
|
+
# characters.
|
90
|
+
# * Returns INVALID_ARGUMENT if description is longer than 4096 characters.
|
91
|
+
# * Returns INVALID_ARGUMENT if product_category is missing or invalid.
|
92
|
+
rpc :CreateProduct, CreateProductRequest, Product
|
93
|
+
# Lists products in an unspecified order.
|
94
|
+
#
|
95
|
+
# Possible errors:
|
96
|
+
#
|
97
|
+
# * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
|
98
|
+
rpc :ListProducts, ListProductsRequest, ListProductsResponse
|
99
|
+
# Gets information associated with a Product.
|
100
|
+
#
|
101
|
+
# Possible errors:
|
102
|
+
#
|
103
|
+
# * Returns NOT_FOUND if the Product does not exist.
|
104
|
+
rpc :GetProduct, GetProductRequest, Product
|
105
|
+
# Makes changes to a Product resource.
|
106
|
+
# Only the `display_name`, `description`, and `labels` fields can be updated
|
107
|
+
# right now.
|
108
|
+
#
|
109
|
+
# If labels are updated, the change will not be reflected in queries until
|
110
|
+
# the next index time.
|
111
|
+
#
|
112
|
+
# Possible errors:
|
113
|
+
#
|
114
|
+
# * Returns NOT_FOUND if the Product does not exist.
|
115
|
+
# * Returns INVALID_ARGUMENT if display_name is present in update_mask but is
|
116
|
+
# missing from the request or longer than 4096 characters.
|
117
|
+
# * Returns INVALID_ARGUMENT if description is present in update_mask but is
|
118
|
+
# longer than 4096 characters.
|
119
|
+
# * Returns INVALID_ARGUMENT if product_category is present in update_mask.
|
120
|
+
rpc :UpdateProduct, UpdateProductRequest, Product
|
121
|
+
# Permanently deletes a product and its reference images.
|
122
|
+
#
|
123
|
+
# Metadata of the product and all its images will be deleted right away, but
|
124
|
+
# search queries against ProductSets containing the product may still work
|
125
|
+
# until all related caches are refreshed.
|
126
|
+
rpc :DeleteProduct, DeleteProductRequest, Google::Protobuf::Empty
|
127
|
+
# Creates and returns a new ReferenceImage resource.
|
128
|
+
#
|
129
|
+
# The `bounding_poly` field is optional. If `bounding_poly` is not specified,
|
130
|
+
# the system will try to detect regions of interest in the image that are
|
131
|
+
# compatible with the product_category on the parent product. If it is
|
132
|
+
# specified, detection is ALWAYS skipped. The system converts polygons into
|
133
|
+
# non-rotated rectangles.
|
134
|
+
#
|
135
|
+
# Note that the pipeline will resize the image if the image resolution is too
|
136
|
+
# large to process (above 50MP).
|
137
|
+
#
|
138
|
+
# Possible errors:
|
139
|
+
#
|
140
|
+
# * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096
|
141
|
+
# characters.
|
142
|
+
# * Returns INVALID_ARGUMENT if the product does not exist.
|
143
|
+
# * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing
|
144
|
+
# compatible with the parent product's product_category is detected.
|
145
|
+
# * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
|
146
|
+
rpc :CreateReferenceImage, CreateReferenceImageRequest, ReferenceImage
|
147
|
+
# Permanently deletes a reference image.
|
148
|
+
#
|
149
|
+
# The image metadata will be deleted right away, but search queries
|
150
|
+
# against ProductSets containing the image may still work until all related
|
151
|
+
# caches are refreshed.
|
152
|
+
#
|
153
|
+
# The actual image files are not deleted from Google Cloud Storage.
|
154
|
+
rpc :DeleteReferenceImage, DeleteReferenceImageRequest, Google::Protobuf::Empty
|
155
|
+
# Lists reference images.
|
156
|
+
#
|
157
|
+
# Possible errors:
|
158
|
+
#
|
159
|
+
# * Returns NOT_FOUND if the parent product does not exist.
|
160
|
+
# * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less
|
161
|
+
# than 1.
|
162
|
+
rpc :ListReferenceImages, ListReferenceImagesRequest, ListReferenceImagesResponse
|
163
|
+
# Gets information associated with a ReferenceImage.
|
164
|
+
#
|
165
|
+
# Possible errors:
|
166
|
+
#
|
167
|
+
# * Returns NOT_FOUND if the specified image does not exist.
|
168
|
+
rpc :GetReferenceImage, GetReferenceImageRequest, ReferenceImage
|
169
|
+
# Adds a Product to the specified ProductSet. If the Product is already
|
170
|
+
# present, no change is made.
|
171
|
+
#
|
172
|
+
# One Product can be added to at most 100 ProductSets.
|
173
|
+
#
|
174
|
+
# Possible errors:
|
175
|
+
#
|
176
|
+
# * Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
|
177
|
+
rpc :AddProductToProductSet, AddProductToProductSetRequest, Google::Protobuf::Empty
|
178
|
+
# Removes a Product from the specified ProductSet.
|
179
|
+
rpc :RemoveProductFromProductSet, RemoveProductFromProductSetRequest, Google::Protobuf::Empty
|
180
|
+
# Lists the Products in a ProductSet, in an unspecified order. If the
|
181
|
+
# ProductSet does not exist, the products field of the response will be
|
182
|
+
# empty.
|
183
|
+
#
|
184
|
+
# Possible errors:
|
185
|
+
#
|
186
|
+
# * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
|
187
|
+
rpc :ListProductsInProductSet, ListProductsInProductSetRequest, ListProductsInProductSetResponse
|
188
|
+
# Asynchronous API that imports a list of reference images to specified
|
189
|
+
# product sets based on a list of image information.
|
190
|
+
#
|
191
|
+
# The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the
|
192
|
+
# progress and results of the request.
|
193
|
+
# `Operation.metadata` contains `BatchOperationMetadata`. (progress)
|
194
|
+
# `Operation.response` contains `ImportProductSetsResponse`. (results)
|
195
|
+
#
|
196
|
+
# The input source of this method is a csv file on Google Cloud Storage.
|
197
|
+
# For the format of the csv file please see
|
198
|
+
# [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri].
|
199
|
+
rpc :ImportProductSets, ImportProductSetsRequest, Google::Longrunning::Operation
|
200
|
+
# Asynchronous API to delete all Products in a ProductSet or all Products
|
201
|
+
# that are in no ProductSet.
|
202
|
+
#
|
203
|
+
# If a Product is a member of the specified ProductSet in addition to other
|
204
|
+
# ProductSets, the Product will still be deleted.
|
205
|
+
#
|
206
|
+
# It is recommended to not delete the specified ProductSet until after this
|
207
|
+
# operation has completed. It is also recommended to not add any of the
|
208
|
+
# Products involved in the batch delete to a new ProductSet while this
|
209
|
+
# operation is running because those Products may still end up deleted.
|
210
|
+
#
|
211
|
+
# It's not possible to undo the PurgeProducts operation. Therefore, it is
|
212
|
+
# recommended to keep the csv files used in ImportProductSets (if that was
|
213
|
+
# how you originally built the Product Set) before starting PurgeProducts, in
|
214
|
+
# case you need to re-import the data after deletion.
|
215
|
+
#
|
216
|
+
# If the plan is to purge all of the Products from a ProductSet and then
|
217
|
+
# re-use the empty ProductSet to re-import new Products into the empty
|
218
|
+
# ProductSet, you must wait until the PurgeProducts operation has finished
|
219
|
+
# for that ProductSet.
|
220
|
+
#
|
221
|
+
# The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the
|
222
|
+
# progress and results of the request.
|
223
|
+
# `Operation.metadata` contains `BatchOperationMetadata`. (progress)
|
224
|
+
rpc :PurgeProducts, PurgeProductsRequest, Google::Longrunning::Operation
|
225
|
+
end
|
226
|
+
|
227
|
+
Stub = Service.rpc_stub_class
|
228
|
+
end
|
229
|
+
end
|
230
|
+
end
|
231
|
+
end
|
232
|
+
end
|