google-cloud-vision-v1p3beta1 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-v1p3beta1.rb +1 -0
  7. data/lib/google/cloud/common_resources_pb.rb +15 -0
  8. data/lib/google/cloud/vision/v1p3beta1.rb +20 -0
  9. data/lib/google/cloud/vision/v1p3beta1/geometry_pb.rb +44 -0
  10. data/lib/google/cloud/vision/v1p3beta1/image_annotator.rb +21 -0
  11. data/lib/google/cloud/vision/v1p3beta1/image_annotator/client.rb +462 -0
  12. data/lib/google/cloud/vision/v1p3beta1/image_annotator/credentials.rb +52 -0
  13. data/lib/google/cloud/vision/v1p3beta1/image_annotator/helpers.rb +1228 -0
  14. data/lib/google/cloud/vision/v1p3beta1/image_annotator/operations.rb +558 -0
  15. data/lib/google/cloud/vision/v1p3beta1/image_annotator/paths.rb +52 -0
  16. data/lib/google/cloud/vision/v1p3beta1/image_annotator_pb.rb +307 -0
  17. data/lib/google/cloud/vision/v1p3beta1/image_annotator_services_pb.rb +55 -0
  18. data/lib/google/cloud/vision/v1p3beta1/product_search.rb +21 -0
  19. data/lib/google/cloud/vision/v1p3beta1/product_search/client.rb +2033 -0
  20. data/lib/google/cloud/vision/v1p3beta1/product_search/credentials.rb +52 -0
  21. data/lib/google/cloud/vision/v1p3beta1/product_search/operations.rb +558 -0
  22. data/lib/google/cloud/vision/v1p3beta1/product_search/paths.rb +109 -0
  23. data/lib/google/cloud/vision/v1p3beta1/product_search_pb.rb +66 -0
  24. data/lib/google/cloud/vision/v1p3beta1/product_search_service_pb.rb +195 -0
  25. data/lib/google/cloud/vision/v1p3beta1/product_search_service_services_pb.rb +222 -0
  26. data/lib/google/cloud/vision/v1p3beta1/text_annotation_pb.rb +95 -0
  27. data/lib/google/cloud/vision/v1p3beta1/version.rb +28 -0
  28. data/lib/google/cloud/vision/v1p3beta1/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/v1p3beta1/geometry.rb +91 -0
  33. data/proto_docs/google/cloud/vision/v1p3beta1/image_annotator.rb +869 -0
  34. data/proto_docs/google/cloud/vision/v1p3beta1/product_search.rb +172 -0
  35. data/proto_docs/google/cloud/vision/v1p3beta1/product_search_service.rb +630 -0
  36. data/proto_docs/google/cloud/vision/v1p3beta1/text_annotation.rb +286 -0
  37. data/proto_docs/google/cloud/vision/v1p3beta1/web_detection.rb +120 -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,52 @@
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 V1p3beta1
24
+ module ImageAnnotator
25
+ # Path helper methods for the ImageAnnotator API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified ProductSet resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/locations/{location}/productSets/{product_set}`
33
+ #
34
+ # @param project [String]
35
+ # @param location [String]
36
+ # @param product_set [String]
37
+ #
38
+ # @return [String]
39
+ def product_set_path project:, location:, product_set:
40
+ raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
41
+ raise ArgumentError, "location cannot contain /" if location.to_s.include? "/"
42
+
43
+ "projects/#{project}/locations/#{location}/productSets/#{product_set}"
44
+ end
45
+
46
+ extend self
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,307 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/vision/v1p3beta1/image_annotator.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/cloud/vision/v1p3beta1/geometry_pb'
10
+ require 'google/cloud/vision/v1p3beta1/product_search_pb'
11
+ require 'google/cloud/vision/v1p3beta1/text_annotation_pb'
12
+ require 'google/cloud/vision/v1p3beta1/web_detection_pb'
13
+ require 'google/longrunning/operations_pb'
14
+ require 'google/protobuf/timestamp_pb'
15
+ require 'google/rpc/status_pb'
16
+ require 'google/type/color_pb'
17
+ require 'google/type/latlng_pb'
18
+ Google::Protobuf::DescriptorPool.generated_pool.build do
19
+ add_file("google/cloud/vision/v1p3beta1/image_annotator.proto", :syntax => :proto3) do
20
+ add_message "google.cloud.vision.v1p3beta1.Feature" do
21
+ optional :type, :enum, 1, "google.cloud.vision.v1p3beta1.Feature.Type"
22
+ optional :max_results, :int32, 2
23
+ optional :model, :string, 3
24
+ end
25
+ add_enum "google.cloud.vision.v1p3beta1.Feature.Type" do
26
+ value :TYPE_UNSPECIFIED, 0
27
+ value :FACE_DETECTION, 1
28
+ value :LANDMARK_DETECTION, 2
29
+ value :LOGO_DETECTION, 3
30
+ value :LABEL_DETECTION, 4
31
+ value :TEXT_DETECTION, 5
32
+ value :DOCUMENT_TEXT_DETECTION, 11
33
+ value :SAFE_SEARCH_DETECTION, 6
34
+ value :IMAGE_PROPERTIES, 7
35
+ value :CROP_HINTS, 9
36
+ value :WEB_DETECTION, 10
37
+ value :PRODUCT_SEARCH, 12
38
+ value :OBJECT_LOCALIZATION, 19
39
+ end
40
+ add_message "google.cloud.vision.v1p3beta1.ImageSource" do
41
+ optional :gcs_image_uri, :string, 1
42
+ optional :image_uri, :string, 2
43
+ end
44
+ add_message "google.cloud.vision.v1p3beta1.Image" do
45
+ optional :content, :bytes, 1
46
+ optional :source, :message, 2, "google.cloud.vision.v1p3beta1.ImageSource"
47
+ end
48
+ add_message "google.cloud.vision.v1p3beta1.FaceAnnotation" do
49
+ optional :bounding_poly, :message, 1, "google.cloud.vision.v1p3beta1.BoundingPoly"
50
+ optional :fd_bounding_poly, :message, 2, "google.cloud.vision.v1p3beta1.BoundingPoly"
51
+ repeated :landmarks, :message, 3, "google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark"
52
+ optional :roll_angle, :float, 4
53
+ optional :pan_angle, :float, 5
54
+ optional :tilt_angle, :float, 6
55
+ optional :detection_confidence, :float, 7
56
+ optional :landmarking_confidence, :float, 8
57
+ optional :joy_likelihood, :enum, 9, "google.cloud.vision.v1p3beta1.Likelihood"
58
+ optional :sorrow_likelihood, :enum, 10, "google.cloud.vision.v1p3beta1.Likelihood"
59
+ optional :anger_likelihood, :enum, 11, "google.cloud.vision.v1p3beta1.Likelihood"
60
+ optional :surprise_likelihood, :enum, 12, "google.cloud.vision.v1p3beta1.Likelihood"
61
+ optional :under_exposed_likelihood, :enum, 13, "google.cloud.vision.v1p3beta1.Likelihood"
62
+ optional :blurred_likelihood, :enum, 14, "google.cloud.vision.v1p3beta1.Likelihood"
63
+ optional :headwear_likelihood, :enum, 15, "google.cloud.vision.v1p3beta1.Likelihood"
64
+ end
65
+ add_message "google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark" do
66
+ optional :type, :enum, 3, "google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type"
67
+ optional :position, :message, 4, "google.cloud.vision.v1p3beta1.Position"
68
+ end
69
+ add_enum "google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type" do
70
+ value :UNKNOWN_LANDMARK, 0
71
+ value :LEFT_EYE, 1
72
+ value :RIGHT_EYE, 2
73
+ value :LEFT_OF_LEFT_EYEBROW, 3
74
+ value :RIGHT_OF_LEFT_EYEBROW, 4
75
+ value :LEFT_OF_RIGHT_EYEBROW, 5
76
+ value :RIGHT_OF_RIGHT_EYEBROW, 6
77
+ value :MIDPOINT_BETWEEN_EYES, 7
78
+ value :NOSE_TIP, 8
79
+ value :UPPER_LIP, 9
80
+ value :LOWER_LIP, 10
81
+ value :MOUTH_LEFT, 11
82
+ value :MOUTH_RIGHT, 12
83
+ value :MOUTH_CENTER, 13
84
+ value :NOSE_BOTTOM_RIGHT, 14
85
+ value :NOSE_BOTTOM_LEFT, 15
86
+ value :NOSE_BOTTOM_CENTER, 16
87
+ value :LEFT_EYE_TOP_BOUNDARY, 17
88
+ value :LEFT_EYE_RIGHT_CORNER, 18
89
+ value :LEFT_EYE_BOTTOM_BOUNDARY, 19
90
+ value :LEFT_EYE_LEFT_CORNER, 20
91
+ value :RIGHT_EYE_TOP_BOUNDARY, 21
92
+ value :RIGHT_EYE_RIGHT_CORNER, 22
93
+ value :RIGHT_EYE_BOTTOM_BOUNDARY, 23
94
+ value :RIGHT_EYE_LEFT_CORNER, 24
95
+ value :LEFT_EYEBROW_UPPER_MIDPOINT, 25
96
+ value :RIGHT_EYEBROW_UPPER_MIDPOINT, 26
97
+ value :LEFT_EAR_TRAGION, 27
98
+ value :RIGHT_EAR_TRAGION, 28
99
+ value :LEFT_EYE_PUPIL, 29
100
+ value :RIGHT_EYE_PUPIL, 30
101
+ value :FOREHEAD_GLABELLA, 31
102
+ value :CHIN_GNATHION, 32
103
+ value :CHIN_LEFT_GONION, 33
104
+ value :CHIN_RIGHT_GONION, 34
105
+ end
106
+ add_message "google.cloud.vision.v1p3beta1.LocationInfo" do
107
+ optional :lat_lng, :message, 1, "google.type.LatLng"
108
+ end
109
+ add_message "google.cloud.vision.v1p3beta1.Property" do
110
+ optional :name, :string, 1
111
+ optional :value, :string, 2
112
+ optional :uint64_value, :uint64, 3
113
+ end
114
+ add_message "google.cloud.vision.v1p3beta1.EntityAnnotation" do
115
+ optional :mid, :string, 1
116
+ optional :locale, :string, 2
117
+ optional :description, :string, 3
118
+ optional :score, :float, 4
119
+ optional :confidence, :float, 5
120
+ optional :topicality, :float, 6
121
+ optional :bounding_poly, :message, 7, "google.cloud.vision.v1p3beta1.BoundingPoly"
122
+ repeated :locations, :message, 8, "google.cloud.vision.v1p3beta1.LocationInfo"
123
+ repeated :properties, :message, 9, "google.cloud.vision.v1p3beta1.Property"
124
+ end
125
+ add_message "google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation" do
126
+ optional :mid, :string, 1
127
+ optional :language_code, :string, 2
128
+ optional :name, :string, 3
129
+ optional :score, :float, 4
130
+ optional :bounding_poly, :message, 5, "google.cloud.vision.v1p3beta1.BoundingPoly"
131
+ end
132
+ add_message "google.cloud.vision.v1p3beta1.SafeSearchAnnotation" do
133
+ optional :adult, :enum, 1, "google.cloud.vision.v1p3beta1.Likelihood"
134
+ optional :spoof, :enum, 2, "google.cloud.vision.v1p3beta1.Likelihood"
135
+ optional :medical, :enum, 3, "google.cloud.vision.v1p3beta1.Likelihood"
136
+ optional :violence, :enum, 4, "google.cloud.vision.v1p3beta1.Likelihood"
137
+ optional :racy, :enum, 9, "google.cloud.vision.v1p3beta1.Likelihood"
138
+ end
139
+ add_message "google.cloud.vision.v1p3beta1.LatLongRect" do
140
+ optional :min_lat_lng, :message, 1, "google.type.LatLng"
141
+ optional :max_lat_lng, :message, 2, "google.type.LatLng"
142
+ end
143
+ add_message "google.cloud.vision.v1p3beta1.ColorInfo" do
144
+ optional :color, :message, 1, "google.type.Color"
145
+ optional :score, :float, 2
146
+ optional :pixel_fraction, :float, 3
147
+ end
148
+ add_message "google.cloud.vision.v1p3beta1.DominantColorsAnnotation" do
149
+ repeated :colors, :message, 1, "google.cloud.vision.v1p3beta1.ColorInfo"
150
+ end
151
+ add_message "google.cloud.vision.v1p3beta1.ImageProperties" do
152
+ optional :dominant_colors, :message, 1, "google.cloud.vision.v1p3beta1.DominantColorsAnnotation"
153
+ end
154
+ add_message "google.cloud.vision.v1p3beta1.CropHint" do
155
+ optional :bounding_poly, :message, 1, "google.cloud.vision.v1p3beta1.BoundingPoly"
156
+ optional :confidence, :float, 2
157
+ optional :importance_fraction, :float, 3
158
+ end
159
+ add_message "google.cloud.vision.v1p3beta1.CropHintsAnnotation" do
160
+ repeated :crop_hints, :message, 1, "google.cloud.vision.v1p3beta1.CropHint"
161
+ end
162
+ add_message "google.cloud.vision.v1p3beta1.CropHintsParams" do
163
+ repeated :aspect_ratios, :float, 1
164
+ end
165
+ add_message "google.cloud.vision.v1p3beta1.WebDetectionParams" do
166
+ optional :include_geo_results, :bool, 2
167
+ end
168
+ add_message "google.cloud.vision.v1p3beta1.ImageContext" do
169
+ optional :lat_long_rect, :message, 1, "google.cloud.vision.v1p3beta1.LatLongRect"
170
+ repeated :language_hints, :string, 2
171
+ optional :crop_hints_params, :message, 4, "google.cloud.vision.v1p3beta1.CropHintsParams"
172
+ optional :product_search_params, :message, 5, "google.cloud.vision.v1p3beta1.ProductSearchParams"
173
+ optional :web_detection_params, :message, 6, "google.cloud.vision.v1p3beta1.WebDetectionParams"
174
+ end
175
+ add_message "google.cloud.vision.v1p3beta1.AnnotateImageRequest" do
176
+ optional :image, :message, 1, "google.cloud.vision.v1p3beta1.Image"
177
+ repeated :features, :message, 2, "google.cloud.vision.v1p3beta1.Feature"
178
+ optional :image_context, :message, 3, "google.cloud.vision.v1p3beta1.ImageContext"
179
+ end
180
+ add_message "google.cloud.vision.v1p3beta1.ImageAnnotationContext" do
181
+ optional :uri, :string, 1
182
+ optional :page_number, :int32, 2
183
+ end
184
+ add_message "google.cloud.vision.v1p3beta1.AnnotateImageResponse" do
185
+ repeated :face_annotations, :message, 1, "google.cloud.vision.v1p3beta1.FaceAnnotation"
186
+ repeated :landmark_annotations, :message, 2, "google.cloud.vision.v1p3beta1.EntityAnnotation"
187
+ repeated :logo_annotations, :message, 3, "google.cloud.vision.v1p3beta1.EntityAnnotation"
188
+ repeated :label_annotations, :message, 4, "google.cloud.vision.v1p3beta1.EntityAnnotation"
189
+ repeated :localized_object_annotations, :message, 22, "google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation"
190
+ repeated :text_annotations, :message, 5, "google.cloud.vision.v1p3beta1.EntityAnnotation"
191
+ optional :full_text_annotation, :message, 12, "google.cloud.vision.v1p3beta1.TextAnnotation"
192
+ optional :safe_search_annotation, :message, 6, "google.cloud.vision.v1p3beta1.SafeSearchAnnotation"
193
+ optional :image_properties_annotation, :message, 8, "google.cloud.vision.v1p3beta1.ImageProperties"
194
+ optional :crop_hints_annotation, :message, 11, "google.cloud.vision.v1p3beta1.CropHintsAnnotation"
195
+ optional :web_detection, :message, 13, "google.cloud.vision.v1p3beta1.WebDetection"
196
+ optional :product_search_results, :message, 14, "google.cloud.vision.v1p3beta1.ProductSearchResults"
197
+ optional :error, :message, 9, "google.rpc.Status"
198
+ optional :context, :message, 21, "google.cloud.vision.v1p3beta1.ImageAnnotationContext"
199
+ end
200
+ add_message "google.cloud.vision.v1p3beta1.AnnotateFileResponse" do
201
+ optional :input_config, :message, 1, "google.cloud.vision.v1p3beta1.InputConfig"
202
+ repeated :responses, :message, 2, "google.cloud.vision.v1p3beta1.AnnotateImageResponse"
203
+ end
204
+ add_message "google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest" do
205
+ repeated :requests, :message, 1, "google.cloud.vision.v1p3beta1.AnnotateImageRequest"
206
+ end
207
+ add_message "google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse" do
208
+ repeated :responses, :message, 1, "google.cloud.vision.v1p3beta1.AnnotateImageResponse"
209
+ end
210
+ add_message "google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest" do
211
+ optional :input_config, :message, 1, "google.cloud.vision.v1p3beta1.InputConfig"
212
+ repeated :features, :message, 2, "google.cloud.vision.v1p3beta1.Feature"
213
+ optional :image_context, :message, 3, "google.cloud.vision.v1p3beta1.ImageContext"
214
+ optional :output_config, :message, 4, "google.cloud.vision.v1p3beta1.OutputConfig"
215
+ end
216
+ add_message "google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse" do
217
+ optional :output_config, :message, 1, "google.cloud.vision.v1p3beta1.OutputConfig"
218
+ end
219
+ add_message "google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest" do
220
+ repeated :requests, :message, 1, "google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest"
221
+ end
222
+ add_message "google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse" do
223
+ repeated :responses, :message, 1, "google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse"
224
+ end
225
+ add_message "google.cloud.vision.v1p3beta1.InputConfig" do
226
+ optional :gcs_source, :message, 1, "google.cloud.vision.v1p3beta1.GcsSource"
227
+ optional :mime_type, :string, 2
228
+ end
229
+ add_message "google.cloud.vision.v1p3beta1.OutputConfig" do
230
+ optional :gcs_destination, :message, 1, "google.cloud.vision.v1p3beta1.GcsDestination"
231
+ optional :batch_size, :int32, 2
232
+ end
233
+ add_message "google.cloud.vision.v1p3beta1.GcsSource" do
234
+ optional :uri, :string, 1
235
+ end
236
+ add_message "google.cloud.vision.v1p3beta1.GcsDestination" do
237
+ optional :uri, :string, 1
238
+ end
239
+ add_message "google.cloud.vision.v1p3beta1.OperationMetadata" do
240
+ optional :state, :enum, 1, "google.cloud.vision.v1p3beta1.OperationMetadata.State"
241
+ optional :create_time, :message, 5, "google.protobuf.Timestamp"
242
+ optional :update_time, :message, 6, "google.protobuf.Timestamp"
243
+ end
244
+ add_enum "google.cloud.vision.v1p3beta1.OperationMetadata.State" do
245
+ value :STATE_UNSPECIFIED, 0
246
+ value :CREATED, 1
247
+ value :RUNNING, 2
248
+ value :DONE, 3
249
+ value :CANCELLED, 4
250
+ end
251
+ add_enum "google.cloud.vision.v1p3beta1.Likelihood" do
252
+ value :UNKNOWN, 0
253
+ value :VERY_UNLIKELY, 1
254
+ value :UNLIKELY, 2
255
+ value :POSSIBLE, 3
256
+ value :LIKELY, 4
257
+ value :VERY_LIKELY, 5
258
+ end
259
+ end
260
+ end
261
+
262
+ module Google
263
+ module Cloud
264
+ module Vision
265
+ module V1p3beta1
266
+ Feature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Feature").msgclass
267
+ Feature::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Feature.Type").enummodule
268
+ ImageSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ImageSource").msgclass
269
+ Image = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Image").msgclass
270
+ FaceAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.FaceAnnotation").msgclass
271
+ FaceAnnotation::Landmark = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark").msgclass
272
+ FaceAnnotation::Landmark::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type").enummodule
273
+ LocationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.LocationInfo").msgclass
274
+ Property = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Property").msgclass
275
+ EntityAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.EntityAnnotation").msgclass
276
+ LocalizedObjectAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation").msgclass
277
+ SafeSearchAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.SafeSearchAnnotation").msgclass
278
+ LatLongRect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.LatLongRect").msgclass
279
+ ColorInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ColorInfo").msgclass
280
+ DominantColorsAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.DominantColorsAnnotation").msgclass
281
+ ImageProperties = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ImageProperties").msgclass
282
+ CropHint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.CropHint").msgclass
283
+ CropHintsAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.CropHintsAnnotation").msgclass
284
+ CropHintsParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.CropHintsParams").msgclass
285
+ WebDetectionParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.WebDetectionParams").msgclass
286
+ ImageContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ImageContext").msgclass
287
+ AnnotateImageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.AnnotateImageRequest").msgclass
288
+ ImageAnnotationContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ImageAnnotationContext").msgclass
289
+ AnnotateImageResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.AnnotateImageResponse").msgclass
290
+ AnnotateFileResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.AnnotateFileResponse").msgclass
291
+ BatchAnnotateImagesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest").msgclass
292
+ BatchAnnotateImagesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse").msgclass
293
+ AsyncAnnotateFileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest").msgclass
294
+ AsyncAnnotateFileResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse").msgclass
295
+ AsyncBatchAnnotateFilesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest").msgclass
296
+ AsyncBatchAnnotateFilesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse").msgclass
297
+ InputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.InputConfig").msgclass
298
+ OutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.OutputConfig").msgclass
299
+ GcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.GcsSource").msgclass
300
+ GcsDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.GcsDestination").msgclass
301
+ OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.OperationMetadata").msgclass
302
+ OperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.OperationMetadata.State").enummodule
303
+ Likelihood = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Likelihood").enummodule
304
+ end
305
+ end
306
+ end
307
+ end
@@ -0,0 +1,55 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/cloud/vision/v1p3beta1/image_annotator.proto for package 'google.cloud.vision.v1p3beta1'
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/v1p3beta1/image_annotator_pb'
22
+
23
+ module Google
24
+ module Cloud
25
+ module Vision
26
+ module V1p3beta1
27
+ module ImageAnnotator
28
+ # Service that performs Google Cloud Vision API detection tasks over client
29
+ # images, such as face, landmark, logo, label, and text detection. The
30
+ # ImageAnnotator service returns detected entities from the images.
31
+ class Service
32
+
33
+ include GRPC::GenericService
34
+
35
+ self.marshal_class_method = :encode
36
+ self.unmarshal_class_method = :decode
37
+ self.service_name = 'google.cloud.vision.v1p3beta1.ImageAnnotator'
38
+
39
+ # Run image detection and annotation for a batch of images.
40
+ rpc :BatchAnnotateImages, BatchAnnotateImagesRequest, BatchAnnotateImagesResponse
41
+ # Run asynchronous image detection and annotation for a list of generic
42
+ # files, such as PDF files, which may contain multiple pages and multiple
43
+ # images per page. Progress and results can be retrieved through the
44
+ # `google.longrunning.Operations` interface.
45
+ # `Operation.metadata` contains `OperationMetadata` (metadata).
46
+ # `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results).
47
+ rpc :AsyncBatchAnnotateFiles, AsyncBatchAnnotateFilesRequest, Google::Longrunning::Operation
48
+ end
49
+
50
+ Stub = Service.rpc_stub_class
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,21 @@
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
+ require "google/cloud/vision/v1p3beta1/product_search/client"
20
+ require "google/cloud/vision/v1p3beta1/product_search/operations"
21
+ require "google/cloud/vision/v1p3beta1/product_search/credentials"
@@ -0,0 +1,2033 @@
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
+ require "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/errors"
24
+ require "google/cloud/vision/v1p3beta1/version"
25
+ require "google/cloud/vision/v1p3beta1/product_search_service_pb"
26
+ require "google/cloud/vision/v1p3beta1/product_search/credentials"
27
+ require "google/cloud/vision/v1p3beta1/product_search/paths"
28
+ require "google/cloud/vision/v1p3beta1/product_search/operations"
29
+
30
+ module Google
31
+ module Cloud
32
+ module Vision
33
+ module V1p3beta1
34
+ module ProductSearch
35
+ ##
36
+ # Client for the ProductSearch service.
37
+ #
38
+ # Manages Products and ProductSets of reference images for use in product
39
+ # search. It uses the following resource model:
40
+ #
41
+ # - The API has a collection of {Google::Cloud::Vision::V1p3beta1::ProductSet ProductSet} resources, named
42
+ # `projects/*/locations/*/productSets/*`, which acts as a way to put different
43
+ # products into groups to limit identification.
44
+ #
45
+ # In parallel,
46
+ #
47
+ # - The API has a collection of {Google::Cloud::Vision::V1p3beta1::Product Product} resources, named
48
+ # `projects/*/locations/*/products/*`
49
+ #
50
+ # - Each {Google::Cloud::Vision::V1p3beta1::Product Product} has a collection of {Google::Cloud::Vision::V1p3beta1::ReferenceImage ReferenceImage} resources, named
51
+ # `projects/*/locations/*/products/*/referenceImages/*`
52
+ #
53
+ class Client
54
+ include Paths
55
+
56
+ # @private
57
+ attr_reader :product_search_stub
58
+
59
+ ##
60
+ # Configure the ProductSearch Client class.
61
+ #
62
+ # See {Google::Cloud::Vision::V1p3beta1::ProductSearch::Client::Configuration}
63
+ # for a description of the configuration fields.
64
+ #
65
+ # ## Example
66
+ #
67
+ # To modify the configuration for all ProductSearch clients:
68
+ #
69
+ # Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.configure do |config|
70
+ # config.timeout = 10_000
71
+ # end
72
+ #
73
+ # @yield [config] Configure the Client client.
74
+ # @yieldparam config [Client::Configuration]
75
+ #
76
+ # @return [Client::Configuration]
77
+ #
78
+ def self.configure
79
+ @configure ||= begin
80
+ namespace = ["Google", "Cloud", "Vision", "V1p3beta1"]
81
+ parent_config = while namespace.any?
82
+ parent_name = namespace.join "::"
83
+ parent_const = const_get parent_name
84
+ break parent_const.configure if parent_const&.respond_to? :configure
85
+ namespace.pop
86
+ end
87
+ default_config = Client::Configuration.new parent_config
88
+
89
+ default_config.rpcs.create_product_set.timeout = 600.0
90
+ default_config.rpcs.create_product_set.retry_policy = {
91
+ initial_delay: 0.1,
92
+ max_delay: 60.0,
93
+ multiplier: 1.3,
94
+ retry_codes: []
95
+ }
96
+
97
+ default_config.rpcs.list_product_sets.timeout = 600.0
98
+ default_config.rpcs.list_product_sets.retry_policy = {
99
+ initial_delay: 0.1,
100
+ max_delay: 60.0,
101
+ multiplier: 1.3,
102
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
103
+ }
104
+
105
+ default_config.rpcs.get_product_set.timeout = 600.0
106
+ default_config.rpcs.get_product_set.retry_policy = {
107
+ initial_delay: 0.1,
108
+ max_delay: 60.0,
109
+ multiplier: 1.3,
110
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
111
+ }
112
+
113
+ default_config.rpcs.update_product_set.timeout = 600.0
114
+ default_config.rpcs.update_product_set.retry_policy = {
115
+ initial_delay: 0.1,
116
+ max_delay: 60.0,
117
+ multiplier: 1.3,
118
+ retry_codes: []
119
+ }
120
+
121
+ default_config.rpcs.delete_product_set.timeout = 600.0
122
+ default_config.rpcs.delete_product_set.retry_policy = {
123
+ initial_delay: 0.1,
124
+ max_delay: 60.0,
125
+ multiplier: 1.3,
126
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
127
+ }
128
+
129
+ default_config.rpcs.create_product.timeout = 600.0
130
+ default_config.rpcs.create_product.retry_policy = {
131
+ initial_delay: 0.1,
132
+ max_delay: 60.0,
133
+ multiplier: 1.3,
134
+ retry_codes: []
135
+ }
136
+
137
+ default_config.rpcs.list_products.timeout = 600.0
138
+ default_config.rpcs.list_products.retry_policy = {
139
+ initial_delay: 0.1,
140
+ max_delay: 60.0,
141
+ multiplier: 1.3,
142
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
143
+ }
144
+
145
+ default_config.rpcs.get_product.timeout = 600.0
146
+ default_config.rpcs.get_product.retry_policy = {
147
+ initial_delay: 0.1,
148
+ max_delay: 60.0,
149
+ multiplier: 1.3,
150
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
151
+ }
152
+
153
+ default_config.rpcs.update_product.timeout = 600.0
154
+ default_config.rpcs.update_product.retry_policy = {
155
+ initial_delay: 0.1,
156
+ max_delay: 60.0,
157
+ multiplier: 1.3,
158
+ retry_codes: []
159
+ }
160
+
161
+ default_config.rpcs.delete_product.timeout = 600.0
162
+ default_config.rpcs.delete_product.retry_policy = {
163
+ initial_delay: 0.1,
164
+ max_delay: 60.0,
165
+ multiplier: 1.3,
166
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
167
+ }
168
+
169
+ default_config.rpcs.create_reference_image.timeout = 600.0
170
+ default_config.rpcs.create_reference_image.retry_policy = {
171
+ initial_delay: 0.1,
172
+ max_delay: 60.0,
173
+ multiplier: 1.3,
174
+ retry_codes: []
175
+ }
176
+
177
+ default_config.rpcs.delete_reference_image.timeout = 600.0
178
+ default_config.rpcs.delete_reference_image.retry_policy = {
179
+ initial_delay: 0.1,
180
+ max_delay: 60.0,
181
+ multiplier: 1.3,
182
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
183
+ }
184
+
185
+ default_config.rpcs.list_reference_images.timeout = 600.0
186
+ default_config.rpcs.list_reference_images.retry_policy = {
187
+ initial_delay: 0.1,
188
+ max_delay: 60.0,
189
+ multiplier: 1.3,
190
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
191
+ }
192
+
193
+ default_config.rpcs.get_reference_image.timeout = 600.0
194
+ default_config.rpcs.get_reference_image.retry_policy = {
195
+ initial_delay: 0.1,
196
+ max_delay: 60.0,
197
+ multiplier: 1.3,
198
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
199
+ }
200
+
201
+ default_config.rpcs.add_product_to_product_set.timeout = 600.0
202
+ default_config.rpcs.add_product_to_product_set.retry_policy = {
203
+ initial_delay: 0.1,
204
+ max_delay: 60.0,
205
+ multiplier: 1.3,
206
+ retry_codes: []
207
+ }
208
+
209
+ default_config.rpcs.remove_product_from_product_set.timeout = 600.0
210
+ default_config.rpcs.remove_product_from_product_set.retry_policy = {
211
+ initial_delay: 0.1,
212
+ max_delay: 60.0,
213
+ multiplier: 1.3,
214
+ retry_codes: []
215
+ }
216
+
217
+ default_config.rpcs.list_products_in_product_set.timeout = 600.0
218
+ default_config.rpcs.list_products_in_product_set.retry_policy = {
219
+ initial_delay: 0.1,
220
+ max_delay: 60.0,
221
+ multiplier: 1.3,
222
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
223
+ }
224
+
225
+ default_config.rpcs.import_product_sets.timeout = 600.0
226
+ default_config.rpcs.import_product_sets.retry_policy = {
227
+ initial_delay: 0.1,
228
+ max_delay: 60.0,
229
+ multiplier: 1.3,
230
+ retry_codes: []
231
+ }
232
+
233
+ default_config
234
+ end
235
+ yield @configure if block_given?
236
+ @configure
237
+ end
238
+
239
+ ##
240
+ # Configure the ProductSearch Client instance.
241
+ #
242
+ # The configuration is set to the derived mode, meaning that values can be changed,
243
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
244
+ # should be made on {Client.configure}.
245
+ #
246
+ # See {Google::Cloud::Vision::V1p3beta1::ProductSearch::Client::Configuration}
247
+ # for a description of the configuration fields.
248
+ #
249
+ # @yield [config] Configure the Client client.
250
+ # @yieldparam config [Client::Configuration]
251
+ #
252
+ # @return [Client::Configuration]
253
+ #
254
+ def configure
255
+ yield @config if block_given?
256
+ @config
257
+ end
258
+
259
+ ##
260
+ # Create a new ProductSearch client object.
261
+ #
262
+ # ## Examples
263
+ #
264
+ # To create a new ProductSearch client with the default
265
+ # configuration:
266
+ #
267
+ # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new
268
+ #
269
+ # To create a new ProductSearch client with a custom
270
+ # configuration:
271
+ #
272
+ # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config|
273
+ # config.timeout = 10_000
274
+ # end
275
+ #
276
+ # @yield [config] Configure the ProductSearch client.
277
+ # @yieldparam config [Client::Configuration]
278
+ #
279
+ def initialize
280
+ # These require statements are intentionally placed here to initialize
281
+ # the gRPC module only when it's required.
282
+ # See https://github.com/googleapis/toolkit/issues/446
283
+ require "gapic/grpc"
284
+ require "google/cloud/vision/v1p3beta1/product_search_service_services_pb"
285
+
286
+ # Create the configuration object
287
+ @config = Configuration.new Client.configure
288
+
289
+ # Yield the configuration if needed
290
+ yield @config if block_given?
291
+
292
+ # Create credentials
293
+ credentials = @config.credentials
294
+ credentials ||= Credentials.default scope: @config.scope
295
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
296
+ credentials = Credentials.new credentials, scope: @config.scope
297
+ end
298
+ @quota_project_id = credentials.respond_to?(:quota_project_id) ? credentials.quota_project_id : nil
299
+
300
+ @operations_client = Operations.new do |config|
301
+ config.credentials = credentials
302
+ end
303
+
304
+ @product_search_stub = Gapic::ServiceStub.new(
305
+ Google::Cloud::Vision::V1p3beta1::ProductSearch::Stub,
306
+ credentials: credentials,
307
+ endpoint: @config.endpoint,
308
+ channel_args: @config.channel_args,
309
+ interceptors: @config.interceptors
310
+ )
311
+ end
312
+
313
+ # Service calls
314
+
315
+ ##
316
+ # Creates and returns a new ProductSet resource.
317
+ #
318
+ # Possible errors:
319
+ #
320
+ # * Returns INVALID_ARGUMENT if display_name is missing, or is longer than
321
+ # 4096 characters.
322
+ #
323
+ # @overload create_product_set(request, options = nil)
324
+ # @param request [Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest | Hash]
325
+ # Creates and returns a new ProductSet resource.
326
+ #
327
+ # Possible errors:
328
+ #
329
+ # * Returns INVALID_ARGUMENT if display_name is missing, or is longer than
330
+ # 4096 characters.
331
+ # @param options [Gapic::CallOptions, Hash]
332
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
333
+ #
334
+ # @overload create_product_set(parent: nil, product_set: nil, product_set_id: nil)
335
+ # @param parent [String]
336
+ # Required. The project in which the ProductSet should be created.
337
+ #
338
+ # Format is `projects/PROJECT_ID/locations/LOC_ID`.
339
+ # @param product_set [Google::Cloud::Vision::V1p3beta1::ProductSet | Hash]
340
+ # Required. The ProductSet to create.
341
+ # @param product_set_id [String]
342
+ # A user-supplied resource id for this ProductSet. If set, the server will
343
+ # attempt to use this value as the resource id. If it is already in use, an
344
+ # error is returned with code ALREADY_EXISTS. Must be at most 128 characters
345
+ # long. It cannot contain the character `/`.
346
+ #
347
+ #
348
+ # @yield [response, operation] Access the result along with the RPC operation
349
+ # @yieldparam response [Google::Cloud::Vision::V1p3beta1::ProductSet]
350
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
351
+ #
352
+ # @return [Google::Cloud::Vision::V1p3beta1::ProductSet]
353
+ #
354
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
355
+ #
356
+ def create_product_set request, options = nil
357
+ raise ArgumentError, "request must be provided" if request.nil?
358
+
359
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest
360
+
361
+ # Converts hash and nil to an options object
362
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
363
+
364
+ # Customize the options with defaults
365
+ metadata = @config.rpcs.create_product_set.metadata.to_h
366
+
367
+ # Set x-goog-api-client and x-goog-user-project headers
368
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
369
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
370
+ gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
371
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
372
+
373
+ header_params = {
374
+ "parent" => request.parent
375
+ }
376
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
377
+ metadata[:"x-goog-request-params"] ||= request_params_header
378
+
379
+ options.apply_defaults timeout: @config.rpcs.create_product_set.timeout,
380
+ metadata: metadata,
381
+ retry_policy: @config.rpcs.create_product_set.retry_policy
382
+ options.apply_defaults metadata: @config.metadata,
383
+ retry_policy: @config.retry_policy
384
+
385
+ @product_search_stub.call_rpc :create_product_set, request, options: options do |response, operation|
386
+ yield response, operation if block_given?
387
+ return response
388
+ end
389
+ rescue GRPC::BadStatus => e
390
+ raise Google::Cloud::Error.from_error(e)
391
+ end
392
+
393
+ ##
394
+ # Lists ProductSets in an unspecified order.
395
+ #
396
+ # Possible errors:
397
+ #
398
+ # * Returns INVALID_ARGUMENT if page_size is greater than 100, or less
399
+ # than 1.
400
+ #
401
+ # @overload list_product_sets(request, options = nil)
402
+ # @param request [Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest | Hash]
403
+ # Lists ProductSets in an unspecified order.
404
+ #
405
+ # Possible errors:
406
+ #
407
+ # * Returns INVALID_ARGUMENT if page_size is greater than 100, or less
408
+ # than 1.
409
+ # @param options [Gapic::CallOptions, Hash]
410
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
411
+ #
412
+ # @overload list_product_sets(parent: nil, page_size: nil, page_token: nil)
413
+ # @param parent [String]
414
+ # Required. The project from which ProductSets should be listed.
415
+ #
416
+ # Format is `projects/PROJECT_ID/locations/LOC_ID`.
417
+ # @param page_size [Integer]
418
+ # The maximum number of items to return. Default 10, maximum 100.
419
+ # @param page_token [String]
420
+ # The next_page_token returned from a previous List request, if any.
421
+ #
422
+ #
423
+ # @yield [response, operation] Access the result along with the RPC operation
424
+ # @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::Vision::V1p3beta1::ProductSet>]
425
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
426
+ #
427
+ # @return [Gapic::PagedEnumerable<Google::Cloud::Vision::V1p3beta1::ProductSet>]
428
+ #
429
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
430
+ #
431
+ def list_product_sets request, options = nil
432
+ raise ArgumentError, "request must be provided" if request.nil?
433
+
434
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest
435
+
436
+ # Converts hash and nil to an options object
437
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
438
+
439
+ # Customize the options with defaults
440
+ metadata = @config.rpcs.list_product_sets.metadata.to_h
441
+
442
+ # Set x-goog-api-client and x-goog-user-project headers
443
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
444
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
445
+ gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
446
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
447
+
448
+ header_params = {
449
+ "parent" => request.parent
450
+ }
451
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
452
+ metadata[:"x-goog-request-params"] ||= request_params_header
453
+
454
+ options.apply_defaults timeout: @config.rpcs.list_product_sets.timeout,
455
+ metadata: metadata,
456
+ retry_policy: @config.rpcs.list_product_sets.retry_policy
457
+ options.apply_defaults metadata: @config.metadata,
458
+ retry_policy: @config.retry_policy
459
+
460
+ @product_search_stub.call_rpc :list_product_sets, request, options: options do |response, operation|
461
+ response = Gapic::PagedEnumerable.new @product_search_stub, :list_product_sets, request, response, operation, options
462
+ yield response, operation if block_given?
463
+ return response
464
+ end
465
+ rescue GRPC::BadStatus => e
466
+ raise Google::Cloud::Error.from_error(e)
467
+ end
468
+
469
+ ##
470
+ # Gets information associated with a ProductSet.
471
+ #
472
+ # Possible errors:
473
+ #
474
+ # * Returns NOT_FOUND if the ProductSet does not exist.
475
+ #
476
+ # @overload get_product_set(request, options = nil)
477
+ # @param request [Google::Cloud::Vision::V1p3beta1::GetProductSetRequest | Hash]
478
+ # Gets information associated with a ProductSet.
479
+ #
480
+ # Possible errors:
481
+ #
482
+ # * Returns NOT_FOUND if the ProductSet does not exist.
483
+ # @param options [Gapic::CallOptions, Hash]
484
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
485
+ #
486
+ # @overload get_product_set(name: nil)
487
+ # @param name [String]
488
+ # Required. Resource name of the ProductSet to get.
489
+ #
490
+ # Format is:
491
+ # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
492
+ #
493
+ #
494
+ # @yield [response, operation] Access the result along with the RPC operation
495
+ # @yieldparam response [Google::Cloud::Vision::V1p3beta1::ProductSet]
496
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
497
+ #
498
+ # @return [Google::Cloud::Vision::V1p3beta1::ProductSet]
499
+ #
500
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
501
+ #
502
+ def get_product_set request, options = nil
503
+ raise ArgumentError, "request must be provided" if request.nil?
504
+
505
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1p3beta1::GetProductSetRequest
506
+
507
+ # Converts hash and nil to an options object
508
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
509
+
510
+ # Customize the options with defaults
511
+ metadata = @config.rpcs.get_product_set.metadata.to_h
512
+
513
+ # Set x-goog-api-client and x-goog-user-project headers
514
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
515
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
516
+ gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
517
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
518
+
519
+ header_params = {
520
+ "name" => request.name
521
+ }
522
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
523
+ metadata[:"x-goog-request-params"] ||= request_params_header
524
+
525
+ options.apply_defaults timeout: @config.rpcs.get_product_set.timeout,
526
+ metadata: metadata,
527
+ retry_policy: @config.rpcs.get_product_set.retry_policy
528
+ options.apply_defaults metadata: @config.metadata,
529
+ retry_policy: @config.retry_policy
530
+
531
+ @product_search_stub.call_rpc :get_product_set, request, options: options do |response, operation|
532
+ yield response, operation if block_given?
533
+ return response
534
+ end
535
+ rescue GRPC::BadStatus => e
536
+ raise Google::Cloud::Error.from_error(e)
537
+ end
538
+
539
+ ##
540
+ # Makes changes to a ProductSet resource.
541
+ # Only display_name can be updated currently.
542
+ #
543
+ # Possible errors:
544
+ #
545
+ # * Returns NOT_FOUND if the ProductSet does not exist.
546
+ # * Returns INVALID_ARGUMENT if display_name is present in update_mask but
547
+ # missing from the request or longer than 4096 characters.
548
+ #
549
+ # @overload update_product_set(request, options = nil)
550
+ # @param request [Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest | Hash]
551
+ # Makes changes to a ProductSet resource.
552
+ # Only display_name can be updated currently.
553
+ #
554
+ # Possible errors:
555
+ #
556
+ # * Returns NOT_FOUND if the ProductSet does not exist.
557
+ # * Returns INVALID_ARGUMENT if display_name is present in update_mask but
558
+ # missing from the request or longer than 4096 characters.
559
+ # @param options [Gapic::CallOptions, Hash]
560
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
561
+ #
562
+ # @overload update_product_set(product_set: nil, update_mask: nil)
563
+ # @param product_set [Google::Cloud::Vision::V1p3beta1::ProductSet | Hash]
564
+ # Required. The ProductSet resource which replaces the one on the server.
565
+ # @param update_mask [Google::Protobuf::FieldMask | Hash]
566
+ # The {Google::Protobuf::FieldMask FieldMask} that specifies which fields to
567
+ # update.
568
+ # If update_mask isn't specified, all mutable fields are to be updated.
569
+ # Valid mask path is `display_name`.
570
+ #
571
+ #
572
+ # @yield [response, operation] Access the result along with the RPC operation
573
+ # @yieldparam response [Google::Cloud::Vision::V1p3beta1::ProductSet]
574
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
575
+ #
576
+ # @return [Google::Cloud::Vision::V1p3beta1::ProductSet]
577
+ #
578
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
579
+ #
580
+ def update_product_set request, options = nil
581
+ raise ArgumentError, "request must be provided" if request.nil?
582
+
583
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest
584
+
585
+ # Converts hash and nil to an options object
586
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
587
+
588
+ # Customize the options with defaults
589
+ metadata = @config.rpcs.update_product_set.metadata.to_h
590
+
591
+ # Set x-goog-api-client and x-goog-user-project headers
592
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
593
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
594
+ gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
595
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
596
+
597
+ header_params = {
598
+ "product_set.name" => request.product_set.name
599
+ }
600
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
601
+ metadata[:"x-goog-request-params"] ||= request_params_header
602
+
603
+ options.apply_defaults timeout: @config.rpcs.update_product_set.timeout,
604
+ metadata: metadata,
605
+ retry_policy: @config.rpcs.update_product_set.retry_policy
606
+ options.apply_defaults metadata: @config.metadata,
607
+ retry_policy: @config.retry_policy
608
+
609
+ @product_search_stub.call_rpc :update_product_set, request, options: options do |response, operation|
610
+ yield response, operation if block_given?
611
+ return response
612
+ end
613
+ rescue GRPC::BadStatus => e
614
+ raise Google::Cloud::Error.from_error(e)
615
+ end
616
+
617
+ ##
618
+ # Permanently deletes a ProductSet. All Products and ReferenceImages in the
619
+ # ProductSet will be deleted.
620
+ #
621
+ # The actual image files are not deleted from Google Cloud Storage.
622
+ #
623
+ # Possible errors:
624
+ #
625
+ # * Returns NOT_FOUND if the ProductSet does not exist.
626
+ #
627
+ # @overload delete_product_set(request, options = nil)
628
+ # @param request [Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest | Hash]
629
+ # Permanently deletes a ProductSet. All Products and ReferenceImages in the
630
+ # ProductSet will be deleted.
631
+ #
632
+ # The actual image files are not deleted from Google Cloud Storage.
633
+ #
634
+ # Possible errors:
635
+ #
636
+ # * Returns NOT_FOUND if the ProductSet does not exist.
637
+ # @param options [Gapic::CallOptions, Hash]
638
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
639
+ #
640
+ # @overload delete_product_set(name: nil)
641
+ # @param name [String]
642
+ # Required. Resource name of the ProductSet to delete.
643
+ #
644
+ # Format is:
645
+ # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
646
+ #
647
+ #
648
+ # @yield [response, operation] Access the result along with the RPC operation
649
+ # @yieldparam response [Google::Protobuf::Empty]
650
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
651
+ #
652
+ # @return [Google::Protobuf::Empty]
653
+ #
654
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
655
+ #
656
+ def delete_product_set request, options = nil
657
+ raise ArgumentError, "request must be provided" if request.nil?
658
+
659
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest
660
+
661
+ # Converts hash and nil to an options object
662
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
663
+
664
+ # Customize the options with defaults
665
+ metadata = @config.rpcs.delete_product_set.metadata.to_h
666
+
667
+ # Set x-goog-api-client and x-goog-user-project headers
668
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
669
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
670
+ gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
671
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
672
+
673
+ header_params = {
674
+ "name" => request.name
675
+ }
676
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
677
+ metadata[:"x-goog-request-params"] ||= request_params_header
678
+
679
+ options.apply_defaults timeout: @config.rpcs.delete_product_set.timeout,
680
+ metadata: metadata,
681
+ retry_policy: @config.rpcs.delete_product_set.retry_policy
682
+ options.apply_defaults metadata: @config.metadata,
683
+ retry_policy: @config.retry_policy
684
+
685
+ @product_search_stub.call_rpc :delete_product_set, request, options: options do |response, operation|
686
+ yield response, operation if block_given?
687
+ return response
688
+ end
689
+ rescue GRPC::BadStatus => e
690
+ raise Google::Cloud::Error.from_error(e)
691
+ end
692
+
693
+ ##
694
+ # Creates and returns a new product resource.
695
+ #
696
+ # Possible errors:
697
+ #
698
+ # * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096
699
+ # characters.
700
+ # * Returns INVALID_ARGUMENT if description is longer than 4096 characters.
701
+ # * Returns INVALID_ARGUMENT if product_category is missing or invalid.
702
+ #
703
+ # @overload create_product(request, options = nil)
704
+ # @param request [Google::Cloud::Vision::V1p3beta1::CreateProductRequest | Hash]
705
+ # Creates and returns a new product resource.
706
+ #
707
+ # Possible errors:
708
+ #
709
+ # * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096
710
+ # characters.
711
+ # * Returns INVALID_ARGUMENT if description is longer than 4096 characters.
712
+ # * Returns INVALID_ARGUMENT if product_category is missing or invalid.
713
+ # @param options [Gapic::CallOptions, Hash]
714
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
715
+ #
716
+ # @overload create_product(parent: nil, product: nil, product_id: nil)
717
+ # @param parent [String]
718
+ # Required. The project in which the Product should be created.
719
+ #
720
+ # Format is
721
+ # `projects/PROJECT_ID/locations/LOC_ID`.
722
+ # @param product [Google::Cloud::Vision::V1p3beta1::Product | Hash]
723
+ # Required. The product to create.
724
+ # @param product_id [String]
725
+ # A user-supplied resource id for this Product. If set, the server will
726
+ # attempt to use this value as the resource id. If it is already in use, an
727
+ # error is returned with code ALREADY_EXISTS. Must be at most 128 characters
728
+ # long. It cannot contain the character `/`.
729
+ #
730
+ #
731
+ # @yield [response, operation] Access the result along with the RPC operation
732
+ # @yieldparam response [Google::Cloud::Vision::V1p3beta1::Product]
733
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
734
+ #
735
+ # @return [Google::Cloud::Vision::V1p3beta1::Product]
736
+ #
737
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
738
+ #
739
+ def create_product request, options = nil
740
+ raise ArgumentError, "request must be provided" if request.nil?
741
+
742
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1p3beta1::CreateProductRequest
743
+
744
+ # Converts hash and nil to an options object
745
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
746
+
747
+ # Customize the options with defaults
748
+ metadata = @config.rpcs.create_product.metadata.to_h
749
+
750
+ # Set x-goog-api-client and x-goog-user-project headers
751
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
752
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
753
+ gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
754
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
755
+
756
+ header_params = {
757
+ "parent" => request.parent
758
+ }
759
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
760
+ metadata[:"x-goog-request-params"] ||= request_params_header
761
+
762
+ options.apply_defaults timeout: @config.rpcs.create_product.timeout,
763
+ metadata: metadata,
764
+ retry_policy: @config.rpcs.create_product.retry_policy
765
+ options.apply_defaults metadata: @config.metadata,
766
+ retry_policy: @config.retry_policy
767
+
768
+ @product_search_stub.call_rpc :create_product, request, options: options do |response, operation|
769
+ yield response, operation if block_given?
770
+ return response
771
+ end
772
+ rescue GRPC::BadStatus => e
773
+ raise Google::Cloud::Error.from_error(e)
774
+ end
775
+
776
+ ##
777
+ # Lists products in an unspecified order.
778
+ #
779
+ # Possible errors:
780
+ #
781
+ # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
782
+ #
783
+ # @overload list_products(request, options = nil)
784
+ # @param request [Google::Cloud::Vision::V1p3beta1::ListProductsRequest | Hash]
785
+ # Lists products in an unspecified order.
786
+ #
787
+ # Possible errors:
788
+ #
789
+ # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
790
+ # @param options [Gapic::CallOptions, Hash]
791
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
792
+ #
793
+ # @overload list_products(parent: nil, page_size: nil, page_token: nil)
794
+ # @param parent [String]
795
+ # Required. The project OR ProductSet from which Products should be listed.
796
+ #
797
+ # Format:
798
+ # `projects/PROJECT_ID/locations/LOC_ID`
799
+ # @param page_size [Integer]
800
+ # The maximum number of items to return. Default 10, maximum 100.
801
+ # @param page_token [String]
802
+ # The next_page_token returned from a previous List request, if any.
803
+ #
804
+ #
805
+ # @yield [response, operation] Access the result along with the RPC operation
806
+ # @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::Vision::V1p3beta1::Product>]
807
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
808
+ #
809
+ # @return [Gapic::PagedEnumerable<Google::Cloud::Vision::V1p3beta1::Product>]
810
+ #
811
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
812
+ #
813
+ def list_products request, options = nil
814
+ raise ArgumentError, "request must be provided" if request.nil?
815
+
816
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1p3beta1::ListProductsRequest
817
+
818
+ # Converts hash and nil to an options object
819
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
820
+
821
+ # Customize the options with defaults
822
+ metadata = @config.rpcs.list_products.metadata.to_h
823
+
824
+ # Set x-goog-api-client and x-goog-user-project headers
825
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
826
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
827
+ gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
828
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
829
+
830
+ header_params = {
831
+ "parent" => request.parent
832
+ }
833
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
834
+ metadata[:"x-goog-request-params"] ||= request_params_header
835
+
836
+ options.apply_defaults timeout: @config.rpcs.list_products.timeout,
837
+ metadata: metadata,
838
+ retry_policy: @config.rpcs.list_products.retry_policy
839
+ options.apply_defaults metadata: @config.metadata,
840
+ retry_policy: @config.retry_policy
841
+
842
+ @product_search_stub.call_rpc :list_products, request, options: options do |response, operation|
843
+ response = Gapic::PagedEnumerable.new @product_search_stub, :list_products, request, response, operation, options
844
+ yield response, operation if block_given?
845
+ return response
846
+ end
847
+ rescue GRPC::BadStatus => e
848
+ raise Google::Cloud::Error.from_error(e)
849
+ end
850
+
851
+ ##
852
+ # Gets information associated with a Product.
853
+ #
854
+ # Possible errors:
855
+ #
856
+ # * Returns NOT_FOUND if the Product does not exist.
857
+ #
858
+ # @overload get_product(request, options = nil)
859
+ # @param request [Google::Cloud::Vision::V1p3beta1::GetProductRequest | Hash]
860
+ # Gets information associated with a Product.
861
+ #
862
+ # Possible errors:
863
+ #
864
+ # * Returns NOT_FOUND if the Product does not exist.
865
+ # @param options [Gapic::CallOptions, Hash]
866
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
867
+ #
868
+ # @overload get_product(name: nil)
869
+ # @param name [String]
870
+ # Required. Resource name of the Product to get.
871
+ #
872
+ # Format is:
873
+ # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
874
+ #
875
+ #
876
+ # @yield [response, operation] Access the result along with the RPC operation
877
+ # @yieldparam response [Google::Cloud::Vision::V1p3beta1::Product]
878
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
879
+ #
880
+ # @return [Google::Cloud::Vision::V1p3beta1::Product]
881
+ #
882
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
883
+ #
884
+ def get_product request, options = nil
885
+ raise ArgumentError, "request must be provided" if request.nil?
886
+
887
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1p3beta1::GetProductRequest
888
+
889
+ # Converts hash and nil to an options object
890
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
891
+
892
+ # Customize the options with defaults
893
+ metadata = @config.rpcs.get_product.metadata.to_h
894
+
895
+ # Set x-goog-api-client and x-goog-user-project headers
896
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
897
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
898
+ gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
899
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
900
+
901
+ header_params = {
902
+ "name" => request.name
903
+ }
904
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
905
+ metadata[:"x-goog-request-params"] ||= request_params_header
906
+
907
+ options.apply_defaults timeout: @config.rpcs.get_product.timeout,
908
+ metadata: metadata,
909
+ retry_policy: @config.rpcs.get_product.retry_policy
910
+ options.apply_defaults metadata: @config.metadata,
911
+ retry_policy: @config.retry_policy
912
+
913
+ @product_search_stub.call_rpc :get_product, request, options: options do |response, operation|
914
+ yield response, operation if block_given?
915
+ return response
916
+ end
917
+ rescue GRPC::BadStatus => e
918
+ raise Google::Cloud::Error.from_error(e)
919
+ end
920
+
921
+ ##
922
+ # Makes changes to a Product resource.
923
+ # Only display_name, description and labels can be updated right now.
924
+ #
925
+ # If labels are updated, the change will not be reflected in queries until
926
+ # the next index time.
927
+ #
928
+ # Possible errors:
929
+ #
930
+ # * Returns NOT_FOUND if the Product does not exist.
931
+ # * Returns INVALID_ARGUMENT if display_name is present in update_mask but is
932
+ # missing from the request or longer than 4096 characters.
933
+ # * Returns INVALID_ARGUMENT if description is present in update_mask but is
934
+ # longer than 4096 characters.
935
+ # * Returns INVALID_ARGUMENT if product_category is present in update_mask.
936
+ #
937
+ # @overload update_product(request, options = nil)
938
+ # @param request [Google::Cloud::Vision::V1p3beta1::UpdateProductRequest | Hash]
939
+ # Makes changes to a Product resource.
940
+ # Only display_name, description and labels can be updated right now.
941
+ #
942
+ # If labels are updated, the change will not be reflected in queries until
943
+ # the next index time.
944
+ #
945
+ # Possible errors:
946
+ #
947
+ # * Returns NOT_FOUND if the Product does not exist.
948
+ # * Returns INVALID_ARGUMENT if display_name is present in update_mask but is
949
+ # missing from the request or longer than 4096 characters.
950
+ # * Returns INVALID_ARGUMENT if description is present in update_mask but is
951
+ # longer than 4096 characters.
952
+ # * Returns INVALID_ARGUMENT if product_category is present in update_mask.
953
+ # @param options [Gapic::CallOptions, Hash]
954
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
955
+ #
956
+ # @overload update_product(product: nil, update_mask: nil)
957
+ # @param product [Google::Cloud::Vision::V1p3beta1::Product | Hash]
958
+ # Required. The Product resource which replaces the one on the server.
959
+ # product.name is immutable.
960
+ # @param update_mask [Google::Protobuf::FieldMask | Hash]
961
+ # The {Google::Protobuf::FieldMask FieldMask} that specifies which fields
962
+ # to update.
963
+ # If update_mask isn't specified, all mutable fields are to be updated.
964
+ # Valid mask paths include `product_labels`, `display_name`, and
965
+ # `description`.
966
+ #
967
+ #
968
+ # @yield [response, operation] Access the result along with the RPC operation
969
+ # @yieldparam response [Google::Cloud::Vision::V1p3beta1::Product]
970
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
971
+ #
972
+ # @return [Google::Cloud::Vision::V1p3beta1::Product]
973
+ #
974
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
975
+ #
976
+ def update_product request, options = nil
977
+ raise ArgumentError, "request must be provided" if request.nil?
978
+
979
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1p3beta1::UpdateProductRequest
980
+
981
+ # Converts hash and nil to an options object
982
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
983
+
984
+ # Customize the options with defaults
985
+ metadata = @config.rpcs.update_product.metadata.to_h
986
+
987
+ # Set x-goog-api-client and x-goog-user-project headers
988
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
989
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
990
+ gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
991
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
992
+
993
+ header_params = {
994
+ "product.name" => request.product.name
995
+ }
996
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
997
+ metadata[:"x-goog-request-params"] ||= request_params_header
998
+
999
+ options.apply_defaults timeout: @config.rpcs.update_product.timeout,
1000
+ metadata: metadata,
1001
+ retry_policy: @config.rpcs.update_product.retry_policy
1002
+ options.apply_defaults metadata: @config.metadata,
1003
+ retry_policy: @config.retry_policy
1004
+
1005
+ @product_search_stub.call_rpc :update_product, request, options: options do |response, operation|
1006
+ yield response, operation if block_given?
1007
+ return response
1008
+ end
1009
+ rescue GRPC::BadStatus => e
1010
+ raise Google::Cloud::Error.from_error(e)
1011
+ end
1012
+
1013
+ ##
1014
+ # Permanently deletes a product and its reference images.
1015
+ #
1016
+ # Metadata of the product and all its images will be deleted right away, but
1017
+ # search queries against ProductSets containing the product may still work
1018
+ # until all related caches are refreshed.
1019
+ #
1020
+ # Possible errors:
1021
+ #
1022
+ # * Returns NOT_FOUND if the product does not exist.
1023
+ #
1024
+ # @overload delete_product(request, options = nil)
1025
+ # @param request [Google::Cloud::Vision::V1p3beta1::DeleteProductRequest | Hash]
1026
+ # Permanently deletes a product and its reference images.
1027
+ #
1028
+ # Metadata of the product and all its images will be deleted right away, but
1029
+ # search queries against ProductSets containing the product may still work
1030
+ # until all related caches are refreshed.
1031
+ #
1032
+ # Possible errors:
1033
+ #
1034
+ # * Returns NOT_FOUND if the product does not exist.
1035
+ # @param options [Gapic::CallOptions, Hash]
1036
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1037
+ #
1038
+ # @overload delete_product(name: nil)
1039
+ # @param name [String]
1040
+ # Required. Resource name of product to delete.
1041
+ #
1042
+ # Format is:
1043
+ # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
1044
+ #
1045
+ #
1046
+ # @yield [response, operation] Access the result along with the RPC operation
1047
+ # @yieldparam response [Google::Protobuf::Empty]
1048
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1049
+ #
1050
+ # @return [Google::Protobuf::Empty]
1051
+ #
1052
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1053
+ #
1054
+ def delete_product request, options = nil
1055
+ raise ArgumentError, "request must be provided" if request.nil?
1056
+
1057
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1p3beta1::DeleteProductRequest
1058
+
1059
+ # Converts hash and nil to an options object
1060
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1061
+
1062
+ # Customize the options with defaults
1063
+ metadata = @config.rpcs.delete_product.metadata.to_h
1064
+
1065
+ # Set x-goog-api-client and x-goog-user-project headers
1066
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1067
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1068
+ gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
1069
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1070
+
1071
+ header_params = {
1072
+ "name" => request.name
1073
+ }
1074
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1075
+ metadata[:"x-goog-request-params"] ||= request_params_header
1076
+
1077
+ options.apply_defaults timeout: @config.rpcs.delete_product.timeout,
1078
+ metadata: metadata,
1079
+ retry_policy: @config.rpcs.delete_product.retry_policy
1080
+ options.apply_defaults metadata: @config.metadata,
1081
+ retry_policy: @config.retry_policy
1082
+
1083
+ @product_search_stub.call_rpc :delete_product, request, options: options do |response, operation|
1084
+ yield response, operation if block_given?
1085
+ return response
1086
+ end
1087
+ rescue GRPC::BadStatus => e
1088
+ raise Google::Cloud::Error.from_error(e)
1089
+ end
1090
+
1091
+ ##
1092
+ # Creates and returns a new ReferenceImage resource.
1093
+ #
1094
+ # The `bounding_poly` field is optional. If `bounding_poly` is not specified,
1095
+ # the system will try to detect regions of interest in the image that are
1096
+ # compatible with the product_category on the parent product. If it is
1097
+ # specified, detection is ALWAYS skipped. The system converts polygons into
1098
+ # non-rotated rectangles.
1099
+ #
1100
+ # Note that the pipeline will resize the image if the image resolution is too
1101
+ # large to process (above 50MP).
1102
+ #
1103
+ # Possible errors:
1104
+ #
1105
+ # * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096
1106
+ # characters.
1107
+ # * Returns INVALID_ARGUMENT if the product does not exist.
1108
+ # * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing
1109
+ # compatible with the parent product's product_category is detected.
1110
+ # * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
1111
+ #
1112
+ # @overload create_reference_image(request, options = nil)
1113
+ # @param request [Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest | Hash]
1114
+ # Creates and returns a new ReferenceImage resource.
1115
+ #
1116
+ # The `bounding_poly` field is optional. If `bounding_poly` is not specified,
1117
+ # the system will try to detect regions of interest in the image that are
1118
+ # compatible with the product_category on the parent product. If it is
1119
+ # specified, detection is ALWAYS skipped. The system converts polygons into
1120
+ # non-rotated rectangles.
1121
+ #
1122
+ # Note that the pipeline will resize the image if the image resolution is too
1123
+ # large to process (above 50MP).
1124
+ #
1125
+ # Possible errors:
1126
+ #
1127
+ # * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096
1128
+ # characters.
1129
+ # * Returns INVALID_ARGUMENT if the product does not exist.
1130
+ # * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing
1131
+ # compatible with the parent product's product_category is detected.
1132
+ # * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
1133
+ # @param options [Gapic::CallOptions, Hash]
1134
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1135
+ #
1136
+ # @overload create_reference_image(parent: nil, reference_image: nil, reference_image_id: nil)
1137
+ # @param parent [String]
1138
+ # Required. Resource name of the product in which to create the reference image.
1139
+ #
1140
+ # Format is
1141
+ # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
1142
+ # @param reference_image [Google::Cloud::Vision::V1p3beta1::ReferenceImage | Hash]
1143
+ # Required. The reference image to create.
1144
+ # If an image ID is specified, it is ignored.
1145
+ # @param reference_image_id [String]
1146
+ # A user-supplied resource id for the ReferenceImage to be added. If set,
1147
+ # the server will attempt to use this value as the resource id. If it is
1148
+ # already in use, an error is returned with code ALREADY_EXISTS. Must be at
1149
+ # most 128 characters long. It cannot contain the character `/`.
1150
+ #
1151
+ #
1152
+ # @yield [response, operation] Access the result along with the RPC operation
1153
+ # @yieldparam response [Google::Cloud::Vision::V1p3beta1::ReferenceImage]
1154
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1155
+ #
1156
+ # @return [Google::Cloud::Vision::V1p3beta1::ReferenceImage]
1157
+ #
1158
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1159
+ #
1160
+ def create_reference_image request, options = nil
1161
+ raise ArgumentError, "request must be provided" if request.nil?
1162
+
1163
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest
1164
+
1165
+ # Converts hash and nil to an options object
1166
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1167
+
1168
+ # Customize the options with defaults
1169
+ metadata = @config.rpcs.create_reference_image.metadata.to_h
1170
+
1171
+ # Set x-goog-api-client and x-goog-user-project headers
1172
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1173
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1174
+ gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
1175
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1176
+
1177
+ header_params = {
1178
+ "parent" => request.parent
1179
+ }
1180
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1181
+ metadata[:"x-goog-request-params"] ||= request_params_header
1182
+
1183
+ options.apply_defaults timeout: @config.rpcs.create_reference_image.timeout,
1184
+ metadata: metadata,
1185
+ retry_policy: @config.rpcs.create_reference_image.retry_policy
1186
+ options.apply_defaults metadata: @config.metadata,
1187
+ retry_policy: @config.retry_policy
1188
+
1189
+ @product_search_stub.call_rpc :create_reference_image, request, options: options do |response, operation|
1190
+ yield response, operation if block_given?
1191
+ return response
1192
+ end
1193
+ rescue GRPC::BadStatus => e
1194
+ raise Google::Cloud::Error.from_error(e)
1195
+ end
1196
+
1197
+ ##
1198
+ # Permanently deletes a reference image.
1199
+ #
1200
+ # The image metadata will be deleted right away, but search queries
1201
+ # against ProductSets containing the image may still work until all related
1202
+ # caches are refreshed.
1203
+ #
1204
+ # The actual image files are not deleted from Google Cloud Storage.
1205
+ #
1206
+ # Possible errors:
1207
+ #
1208
+ # * Returns NOT_FOUND if the reference image does not exist.
1209
+ #
1210
+ # @overload delete_reference_image(request, options = nil)
1211
+ # @param request [Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest | Hash]
1212
+ # Permanently deletes a reference image.
1213
+ #
1214
+ # The image metadata will be deleted right away, but search queries
1215
+ # against ProductSets containing the image may still work until all related
1216
+ # caches are refreshed.
1217
+ #
1218
+ # The actual image files are not deleted from Google Cloud Storage.
1219
+ #
1220
+ # Possible errors:
1221
+ #
1222
+ # * Returns NOT_FOUND if the reference image does not exist.
1223
+ # @param options [Gapic::CallOptions, Hash]
1224
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1225
+ #
1226
+ # @overload delete_reference_image(name: nil)
1227
+ # @param name [String]
1228
+ # Required. The resource name of the reference image to delete.
1229
+ #
1230
+ # Format is:
1231
+ #
1232
+ # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`
1233
+ #
1234
+ #
1235
+ # @yield [response, operation] Access the result along with the RPC operation
1236
+ # @yieldparam response [Google::Protobuf::Empty]
1237
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1238
+ #
1239
+ # @return [Google::Protobuf::Empty]
1240
+ #
1241
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1242
+ #
1243
+ def delete_reference_image request, options = nil
1244
+ raise ArgumentError, "request must be provided" if request.nil?
1245
+
1246
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest
1247
+
1248
+ # Converts hash and nil to an options object
1249
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1250
+
1251
+ # Customize the options with defaults
1252
+ metadata = @config.rpcs.delete_reference_image.metadata.to_h
1253
+
1254
+ # Set x-goog-api-client and x-goog-user-project headers
1255
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1256
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1257
+ gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
1258
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1259
+
1260
+ header_params = {
1261
+ "name" => request.name
1262
+ }
1263
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1264
+ metadata[:"x-goog-request-params"] ||= request_params_header
1265
+
1266
+ options.apply_defaults timeout: @config.rpcs.delete_reference_image.timeout,
1267
+ metadata: metadata,
1268
+ retry_policy: @config.rpcs.delete_reference_image.retry_policy
1269
+ options.apply_defaults metadata: @config.metadata,
1270
+ retry_policy: @config.retry_policy
1271
+
1272
+ @product_search_stub.call_rpc :delete_reference_image, request, options: options do |response, operation|
1273
+ yield response, operation if block_given?
1274
+ return response
1275
+ end
1276
+ rescue GRPC::BadStatus => e
1277
+ raise Google::Cloud::Error.from_error(e)
1278
+ end
1279
+
1280
+ ##
1281
+ # Lists reference images.
1282
+ #
1283
+ # Possible errors:
1284
+ #
1285
+ # * Returns NOT_FOUND if the parent product does not exist.
1286
+ # * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less
1287
+ # than 1.
1288
+ #
1289
+ # @overload list_reference_images(request, options = nil)
1290
+ # @param request [Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest | Hash]
1291
+ # Lists reference images.
1292
+ #
1293
+ # Possible errors:
1294
+ #
1295
+ # * Returns NOT_FOUND if the parent product does not exist.
1296
+ # * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less
1297
+ # than 1.
1298
+ # @param options [Gapic::CallOptions, Hash]
1299
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1300
+ #
1301
+ # @overload list_reference_images(parent: nil, page_size: nil, page_token: nil)
1302
+ # @param parent [String]
1303
+ # Required. Resource name of the product containing the reference images.
1304
+ #
1305
+ # Format is
1306
+ # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
1307
+ # @param page_size [Integer]
1308
+ # The maximum number of items to return. Default 10, maximum 100.
1309
+ # @param page_token [String]
1310
+ # A token identifying a page of results to be returned. This is the value
1311
+ # of `nextPageToken` returned in a previous reference image list request.
1312
+ #
1313
+ # Defaults to the first page if not specified.
1314
+ #
1315
+ #
1316
+ # @yield [response, operation] Access the result along with the RPC operation
1317
+ # @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::Vision::V1p3beta1::ReferenceImage>]
1318
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1319
+ #
1320
+ # @return [Gapic::PagedEnumerable<Google::Cloud::Vision::V1p3beta1::ReferenceImage>]
1321
+ #
1322
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1323
+ #
1324
+ def list_reference_images request, options = nil
1325
+ raise ArgumentError, "request must be provided" if request.nil?
1326
+
1327
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest
1328
+
1329
+ # Converts hash and nil to an options object
1330
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1331
+
1332
+ # Customize the options with defaults
1333
+ metadata = @config.rpcs.list_reference_images.metadata.to_h
1334
+
1335
+ # Set x-goog-api-client and x-goog-user-project headers
1336
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1337
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1338
+ gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
1339
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1340
+
1341
+ header_params = {
1342
+ "parent" => request.parent
1343
+ }
1344
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1345
+ metadata[:"x-goog-request-params"] ||= request_params_header
1346
+
1347
+ options.apply_defaults timeout: @config.rpcs.list_reference_images.timeout,
1348
+ metadata: metadata,
1349
+ retry_policy: @config.rpcs.list_reference_images.retry_policy
1350
+ options.apply_defaults metadata: @config.metadata,
1351
+ retry_policy: @config.retry_policy
1352
+
1353
+ @product_search_stub.call_rpc :list_reference_images, request, options: options do |response, operation|
1354
+ response = Gapic::PagedEnumerable.new @product_search_stub, :list_reference_images, request, response, operation, options
1355
+ yield response, operation if block_given?
1356
+ return response
1357
+ end
1358
+ rescue GRPC::BadStatus => e
1359
+ raise Google::Cloud::Error.from_error(e)
1360
+ end
1361
+
1362
+ ##
1363
+ # Gets information associated with a ReferenceImage.
1364
+ #
1365
+ # Possible errors:
1366
+ #
1367
+ # * Returns NOT_FOUND if the specified image does not exist.
1368
+ #
1369
+ # @overload get_reference_image(request, options = nil)
1370
+ # @param request [Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest | Hash]
1371
+ # Gets information associated with a ReferenceImage.
1372
+ #
1373
+ # Possible errors:
1374
+ #
1375
+ # * Returns NOT_FOUND if the specified image does not exist.
1376
+ # @param options [Gapic::CallOptions, Hash]
1377
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1378
+ #
1379
+ # @overload get_reference_image(name: nil)
1380
+ # @param name [String]
1381
+ # Required. The resource name of the ReferenceImage to get.
1382
+ #
1383
+ # Format is:
1384
+ #
1385
+ # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
1386
+ #
1387
+ #
1388
+ # @yield [response, operation] Access the result along with the RPC operation
1389
+ # @yieldparam response [Google::Cloud::Vision::V1p3beta1::ReferenceImage]
1390
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1391
+ #
1392
+ # @return [Google::Cloud::Vision::V1p3beta1::ReferenceImage]
1393
+ #
1394
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1395
+ #
1396
+ def get_reference_image request, options = nil
1397
+ raise ArgumentError, "request must be provided" if request.nil?
1398
+
1399
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest
1400
+
1401
+ # Converts hash and nil to an options object
1402
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1403
+
1404
+ # Customize the options with defaults
1405
+ metadata = @config.rpcs.get_reference_image.metadata.to_h
1406
+
1407
+ # Set x-goog-api-client and x-goog-user-project headers
1408
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1409
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1410
+ gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
1411
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1412
+
1413
+ header_params = {
1414
+ "name" => request.name
1415
+ }
1416
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1417
+ metadata[:"x-goog-request-params"] ||= request_params_header
1418
+
1419
+ options.apply_defaults timeout: @config.rpcs.get_reference_image.timeout,
1420
+ metadata: metadata,
1421
+ retry_policy: @config.rpcs.get_reference_image.retry_policy
1422
+ options.apply_defaults metadata: @config.metadata,
1423
+ retry_policy: @config.retry_policy
1424
+
1425
+ @product_search_stub.call_rpc :get_reference_image, request, options: options do |response, operation|
1426
+ yield response, operation if block_given?
1427
+ return response
1428
+ end
1429
+ rescue GRPC::BadStatus => e
1430
+ raise Google::Cloud::Error.from_error(e)
1431
+ end
1432
+
1433
+ ##
1434
+ # Adds a Product to the specified ProductSet. If the Product is already
1435
+ # present, no change is made.
1436
+ #
1437
+ # One Product can be added to at most 100 ProductSets.
1438
+ #
1439
+ # Possible errors:
1440
+ #
1441
+ # * Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
1442
+ #
1443
+ # @overload add_product_to_product_set(request, options = nil)
1444
+ # @param request [Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest | Hash]
1445
+ # Adds a Product to the specified ProductSet. If the Product is already
1446
+ # present, no change is made.
1447
+ #
1448
+ # One Product can be added to at most 100 ProductSets.
1449
+ #
1450
+ # Possible errors:
1451
+ #
1452
+ # * Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
1453
+ # @param options [Gapic::CallOptions, Hash]
1454
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1455
+ #
1456
+ # @overload add_product_to_product_set(name: nil, product: nil)
1457
+ # @param name [String]
1458
+ # Required. The resource name for the ProductSet to modify.
1459
+ #
1460
+ # Format is:
1461
+ # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
1462
+ # @param product [String]
1463
+ # Required. The resource name for the Product to be added to this ProductSet.
1464
+ #
1465
+ # Format is:
1466
+ # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
1467
+ #
1468
+ #
1469
+ # @yield [response, operation] Access the result along with the RPC operation
1470
+ # @yieldparam response [Google::Protobuf::Empty]
1471
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1472
+ #
1473
+ # @return [Google::Protobuf::Empty]
1474
+ #
1475
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1476
+ #
1477
+ def add_product_to_product_set request, options = nil
1478
+ raise ArgumentError, "request must be provided" if request.nil?
1479
+
1480
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest
1481
+
1482
+ # Converts hash and nil to an options object
1483
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1484
+
1485
+ # Customize the options with defaults
1486
+ metadata = @config.rpcs.add_product_to_product_set.metadata.to_h
1487
+
1488
+ # Set x-goog-api-client and x-goog-user-project headers
1489
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1490
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1491
+ gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
1492
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1493
+
1494
+ header_params = {
1495
+ "name" => request.name
1496
+ }
1497
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1498
+ metadata[:"x-goog-request-params"] ||= request_params_header
1499
+
1500
+ options.apply_defaults timeout: @config.rpcs.add_product_to_product_set.timeout,
1501
+ metadata: metadata,
1502
+ retry_policy: @config.rpcs.add_product_to_product_set.retry_policy
1503
+ options.apply_defaults metadata: @config.metadata,
1504
+ retry_policy: @config.retry_policy
1505
+
1506
+ @product_search_stub.call_rpc :add_product_to_product_set, request, options: options do |response, operation|
1507
+ yield response, operation if block_given?
1508
+ return response
1509
+ end
1510
+ rescue GRPC::BadStatus => e
1511
+ raise Google::Cloud::Error.from_error(e)
1512
+ end
1513
+
1514
+ ##
1515
+ # Removes a Product from the specified ProductSet.
1516
+ #
1517
+ # Possible errors:
1518
+ #
1519
+ # * Returns NOT_FOUND If the Product is not found under the ProductSet.
1520
+ #
1521
+ # @overload remove_product_from_product_set(request, options = nil)
1522
+ # @param request [Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest | Hash]
1523
+ # Removes a Product from the specified ProductSet.
1524
+ #
1525
+ # Possible errors:
1526
+ #
1527
+ # * Returns NOT_FOUND If the Product is not found under the ProductSet.
1528
+ # @param options [Gapic::CallOptions, Hash]
1529
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1530
+ #
1531
+ # @overload remove_product_from_product_set(name: nil, product: nil)
1532
+ # @param name [String]
1533
+ # Required. The resource name for the ProductSet to modify.
1534
+ #
1535
+ # Format is:
1536
+ # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
1537
+ # @param product [String]
1538
+ # Required. The resource name for the Product to be removed from this ProductSet.
1539
+ #
1540
+ # Format is:
1541
+ # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
1542
+ #
1543
+ #
1544
+ # @yield [response, operation] Access the result along with the RPC operation
1545
+ # @yieldparam response [Google::Protobuf::Empty]
1546
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1547
+ #
1548
+ # @return [Google::Protobuf::Empty]
1549
+ #
1550
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1551
+ #
1552
+ def remove_product_from_product_set request, options = nil
1553
+ raise ArgumentError, "request must be provided" if request.nil?
1554
+
1555
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest
1556
+
1557
+ # Converts hash and nil to an options object
1558
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1559
+
1560
+ # Customize the options with defaults
1561
+ metadata = @config.rpcs.remove_product_from_product_set.metadata.to_h
1562
+
1563
+ # Set x-goog-api-client and x-goog-user-project headers
1564
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1565
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1566
+ gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
1567
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1568
+
1569
+ header_params = {
1570
+ "name" => request.name
1571
+ }
1572
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1573
+ metadata[:"x-goog-request-params"] ||= request_params_header
1574
+
1575
+ options.apply_defaults timeout: @config.rpcs.remove_product_from_product_set.timeout,
1576
+ metadata: metadata,
1577
+ retry_policy: @config.rpcs.remove_product_from_product_set.retry_policy
1578
+ options.apply_defaults metadata: @config.metadata,
1579
+ retry_policy: @config.retry_policy
1580
+
1581
+ @product_search_stub.call_rpc :remove_product_from_product_set, request, options: options do |response, operation|
1582
+ yield response, operation if block_given?
1583
+ return response
1584
+ end
1585
+ rescue GRPC::BadStatus => e
1586
+ raise Google::Cloud::Error.from_error(e)
1587
+ end
1588
+
1589
+ ##
1590
+ # Lists the Products in a ProductSet, in an unspecified order. If the
1591
+ # ProductSet does not exist, the products field of the response will be
1592
+ # empty.
1593
+ #
1594
+ # Possible errors:
1595
+ #
1596
+ # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
1597
+ #
1598
+ # @overload list_products_in_product_set(request, options = nil)
1599
+ # @param request [Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest | Hash]
1600
+ # Lists the Products in a ProductSet, in an unspecified order. If the
1601
+ # ProductSet does not exist, the products field of the response will be
1602
+ # empty.
1603
+ #
1604
+ # Possible errors:
1605
+ #
1606
+ # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
1607
+ # @param options [Gapic::CallOptions, Hash]
1608
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1609
+ #
1610
+ # @overload list_products_in_product_set(name: nil, page_size: nil, page_token: nil)
1611
+ # @param name [String]
1612
+ # Required. The ProductSet resource for which to retrieve Products.
1613
+ #
1614
+ # Format is:
1615
+ # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
1616
+ # @param page_size [Integer]
1617
+ # The maximum number of items to return. Default 10, maximum 100.
1618
+ # @param page_token [String]
1619
+ # The next_page_token returned from a previous List request, if any.
1620
+ #
1621
+ #
1622
+ # @yield [response, operation] Access the result along with the RPC operation
1623
+ # @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::Vision::V1p3beta1::Product>]
1624
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1625
+ #
1626
+ # @return [Gapic::PagedEnumerable<Google::Cloud::Vision::V1p3beta1::Product>]
1627
+ #
1628
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1629
+ #
1630
+ def list_products_in_product_set request, options = nil
1631
+ raise ArgumentError, "request must be provided" if request.nil?
1632
+
1633
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest
1634
+
1635
+ # Converts hash and nil to an options object
1636
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1637
+
1638
+ # Customize the options with defaults
1639
+ metadata = @config.rpcs.list_products_in_product_set.metadata.to_h
1640
+
1641
+ # Set x-goog-api-client and x-goog-user-project headers
1642
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1643
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1644
+ gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
1645
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1646
+
1647
+ header_params = {
1648
+ "name" => request.name
1649
+ }
1650
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1651
+ metadata[:"x-goog-request-params"] ||= request_params_header
1652
+
1653
+ options.apply_defaults timeout: @config.rpcs.list_products_in_product_set.timeout,
1654
+ metadata: metadata,
1655
+ retry_policy: @config.rpcs.list_products_in_product_set.retry_policy
1656
+ options.apply_defaults metadata: @config.metadata,
1657
+ retry_policy: @config.retry_policy
1658
+
1659
+ @product_search_stub.call_rpc :list_products_in_product_set, request, options: options do |response, operation|
1660
+ response = Gapic::PagedEnumerable.new @product_search_stub, :list_products_in_product_set, request, response, operation, options
1661
+ yield response, operation if block_given?
1662
+ return response
1663
+ end
1664
+ rescue GRPC::BadStatus => e
1665
+ raise Google::Cloud::Error.from_error(e)
1666
+ end
1667
+
1668
+ ##
1669
+ # Asynchronous API that imports a list of reference images to specified
1670
+ # product sets based on a list of image information.
1671
+ #
1672
+ # The {Google::Longrunning::Operation google.longrunning.Operation} API can be
1673
+ # used to keep track of the progress and results of the request.
1674
+ # `Operation.metadata` contains `BatchOperationMetadata`. (progress)
1675
+ # `Operation.response` contains `ImportProductSetsResponse`. (results)
1676
+ #
1677
+ # The input source of this method is a csv file on Google Cloud Storage.
1678
+ # For the format of the csv file please see
1679
+ # {Google::Cloud::Vision::V1p3beta1::ImportProductSetsGcsSource#csv_file_uri ImportProductSetsGcsSource.csv_file_uri}.
1680
+ #
1681
+ # @overload import_product_sets(request, options = nil)
1682
+ # @param request [Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest | Hash]
1683
+ # Asynchronous API that imports a list of reference images to specified
1684
+ # product sets based on a list of image information.
1685
+ #
1686
+ # The {Google::Longrunning::Operation google.longrunning.Operation} API can be
1687
+ # used to keep track of the progress and results of the request.
1688
+ # `Operation.metadata` contains `BatchOperationMetadata`. (progress)
1689
+ # `Operation.response` contains `ImportProductSetsResponse`. (results)
1690
+ #
1691
+ # The input source of this method is a csv file on Google Cloud Storage.
1692
+ # For the format of the csv file please see
1693
+ # {Google::Cloud::Vision::V1p3beta1::ImportProductSetsGcsSource#csv_file_uri ImportProductSetsGcsSource.csv_file_uri}.
1694
+ # @param options [Gapic::CallOptions, Hash]
1695
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1696
+ #
1697
+ # @overload import_product_sets(parent: nil, input_config: nil)
1698
+ # @param parent [String]
1699
+ # Required. The project in which the ProductSets should be imported.
1700
+ #
1701
+ # Format is `projects/PROJECT_ID/locations/LOC_ID`.
1702
+ # @param input_config [Google::Cloud::Vision::V1p3beta1::ImportProductSetsInputConfig | Hash]
1703
+ # Required. The input content for the list of requests.
1704
+ #
1705
+ #
1706
+ # @yield [response, operation] Access the result along with the RPC operation
1707
+ # @yieldparam response [Gapic::Operation]
1708
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1709
+ #
1710
+ # @return [Gapic::Operation]
1711
+ #
1712
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1713
+ #
1714
+ def import_product_sets request, options = nil
1715
+ raise ArgumentError, "request must be provided" if request.nil?
1716
+
1717
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest
1718
+
1719
+ # Converts hash and nil to an options object
1720
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1721
+
1722
+ # Customize the options with defaults
1723
+ metadata = @config.rpcs.import_product_sets.metadata.to_h
1724
+
1725
+ # Set x-goog-api-client and x-goog-user-project headers
1726
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1727
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1728
+ gapic_version: ::Google::Cloud::Vision::V1p3beta1::VERSION
1729
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1730
+
1731
+ header_params = {
1732
+ "parent" => request.parent
1733
+ }
1734
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1735
+ metadata[:"x-goog-request-params"] ||= request_params_header
1736
+
1737
+ options.apply_defaults timeout: @config.rpcs.import_product_sets.timeout,
1738
+ metadata: metadata,
1739
+ retry_policy: @config.rpcs.import_product_sets.retry_policy
1740
+ options.apply_defaults metadata: @config.metadata,
1741
+ retry_policy: @config.retry_policy
1742
+
1743
+ @product_search_stub.call_rpc :import_product_sets, request, options: options do |response, operation|
1744
+ response = Gapic::Operation.new response, @operations_client, options: options
1745
+ yield response, operation if block_given?
1746
+ return response
1747
+ end
1748
+ rescue GRPC::BadStatus => e
1749
+ raise Google::Cloud::Error.from_error(e)
1750
+ end
1751
+
1752
+ ##
1753
+ # Configuration class for the ProductSearch API.
1754
+ #
1755
+ # This class represents the configuration for ProductSearch,
1756
+ # providing control over timeouts, retry behavior, logging, transport
1757
+ # parameters, and other low-level controls. Certain parameters can also be
1758
+ # applied individually to specific RPCs. See
1759
+ # {Google::Cloud::Vision::V1p3beta1::ProductSearch::Client::Configuration::Rpcs}
1760
+ # for a list of RPCs that can be configured independently.
1761
+ #
1762
+ # Configuration can be applied globally to all clients, or to a single client
1763
+ # on construction.
1764
+ #
1765
+ # # Examples
1766
+ #
1767
+ # To modify the global config, setting the timeout for create_product_set
1768
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
1769
+ #
1770
+ # Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.configure do |config|
1771
+ # config.timeout = 10_000
1772
+ # config.rpcs.create_product_set.timeout = 20_000
1773
+ # end
1774
+ #
1775
+ # To apply the above configuration only to a new client:
1776
+ #
1777
+ # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config|
1778
+ # config.timeout = 10_000
1779
+ # config.rpcs.create_product_set.timeout = 20_000
1780
+ # end
1781
+ #
1782
+ # @!attribute [rw] endpoint
1783
+ # The hostname or hostname:port of the service endpoint.
1784
+ # Defaults to `"vision.googleapis.com"`.
1785
+ # @return [String]
1786
+ # @!attribute [rw] credentials
1787
+ # Credentials to send with calls. You may provide any of the following types:
1788
+ # * (`String`) The path to a service account key file in JSON format
1789
+ # * (`Hash`) A service account key as a Hash
1790
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1791
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1792
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1793
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1794
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1795
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1796
+ # * (`nil`) indicating no credentials
1797
+ # @return [Object]
1798
+ # @!attribute [rw] scope
1799
+ # The OAuth scopes
1800
+ # @return [Array<String>]
1801
+ # @!attribute [rw] lib_name
1802
+ # The library name as recorded in instrumentation and logging
1803
+ # @return [String]
1804
+ # @!attribute [rw] lib_version
1805
+ # The library version as recorded in instrumentation and logging
1806
+ # @return [String]
1807
+ # @!attribute [rw] channel_args
1808
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1809
+ # `GRPC::Core::Channel` object is provided as the credential.
1810
+ # @return [Hash]
1811
+ # @!attribute [rw] interceptors
1812
+ # An array of interceptors that are run before calls are executed.
1813
+ # @return [Array<GRPC::ClientInterceptor>]
1814
+ # @!attribute [rw] timeout
1815
+ # The call timeout in milliseconds.
1816
+ # @return [Numeric]
1817
+ # @!attribute [rw] metadata
1818
+ # Additional gRPC headers to be sent with the call.
1819
+ # @return [Hash{Symbol=>String}]
1820
+ # @!attribute [rw] retry_policy
1821
+ # The retry policy. The value is a hash with the following keys:
1822
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1823
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1824
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1825
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1826
+ # trigger a retry.
1827
+ # @return [Hash]
1828
+ #
1829
+ class Configuration
1830
+ extend Gapic::Config
1831
+
1832
+ config_attr :endpoint, "vision.googleapis.com", String
1833
+ config_attr :credentials, nil do |value|
1834
+ allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1835
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1836
+ allowed.any? { |klass| klass === value }
1837
+ end
1838
+ config_attr :scope, nil, String, Array, nil
1839
+ config_attr :lib_name, nil, String, nil
1840
+ config_attr :lib_version, nil, String, nil
1841
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, Hash, nil)
1842
+ config_attr :interceptors, nil, Array, nil
1843
+ config_attr :timeout, nil, Numeric, nil
1844
+ config_attr :metadata, nil, Hash, nil
1845
+ config_attr :retry_policy, nil, Hash, Proc, nil
1846
+
1847
+ # @private
1848
+ def initialize parent_config = nil
1849
+ @parent_config = parent_config unless parent_config.nil?
1850
+
1851
+ yield self if block_given?
1852
+ end
1853
+
1854
+ ##
1855
+ # Configurations for individual RPCs
1856
+ # @return [Rpcs]
1857
+ #
1858
+ def rpcs
1859
+ @rpcs ||= begin
1860
+ parent_rpcs = nil
1861
+ parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
1862
+ Rpcs.new parent_rpcs
1863
+ end
1864
+ end
1865
+
1866
+ ##
1867
+ # Configuration RPC class for the ProductSearch API.
1868
+ #
1869
+ # Includes fields providing the configuration for each RPC in this service.
1870
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1871
+ # the following configuration fields:
1872
+ #
1873
+ # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
1874
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1875
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1876
+ # include the following keys:
1877
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1878
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1879
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1880
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1881
+ # trigger a retry.
1882
+ #
1883
+ class Rpcs
1884
+ ##
1885
+ # RPC-specific configuration for `create_product_set`
1886
+ # @return [Gapic::Config::Method]
1887
+ #
1888
+ attr_reader :create_product_set
1889
+ ##
1890
+ # RPC-specific configuration for `list_product_sets`
1891
+ # @return [Gapic::Config::Method]
1892
+ #
1893
+ attr_reader :list_product_sets
1894
+ ##
1895
+ # RPC-specific configuration for `get_product_set`
1896
+ # @return [Gapic::Config::Method]
1897
+ #
1898
+ attr_reader :get_product_set
1899
+ ##
1900
+ # RPC-specific configuration for `update_product_set`
1901
+ # @return [Gapic::Config::Method]
1902
+ #
1903
+ attr_reader :update_product_set
1904
+ ##
1905
+ # RPC-specific configuration for `delete_product_set`
1906
+ # @return [Gapic::Config::Method]
1907
+ #
1908
+ attr_reader :delete_product_set
1909
+ ##
1910
+ # RPC-specific configuration for `create_product`
1911
+ # @return [Gapic::Config::Method]
1912
+ #
1913
+ attr_reader :create_product
1914
+ ##
1915
+ # RPC-specific configuration for `list_products`
1916
+ # @return [Gapic::Config::Method]
1917
+ #
1918
+ attr_reader :list_products
1919
+ ##
1920
+ # RPC-specific configuration for `get_product`
1921
+ # @return [Gapic::Config::Method]
1922
+ #
1923
+ attr_reader :get_product
1924
+ ##
1925
+ # RPC-specific configuration for `update_product`
1926
+ # @return [Gapic::Config::Method]
1927
+ #
1928
+ attr_reader :update_product
1929
+ ##
1930
+ # RPC-specific configuration for `delete_product`
1931
+ # @return [Gapic::Config::Method]
1932
+ #
1933
+ attr_reader :delete_product
1934
+ ##
1935
+ # RPC-specific configuration for `create_reference_image`
1936
+ # @return [Gapic::Config::Method]
1937
+ #
1938
+ attr_reader :create_reference_image
1939
+ ##
1940
+ # RPC-specific configuration for `delete_reference_image`
1941
+ # @return [Gapic::Config::Method]
1942
+ #
1943
+ attr_reader :delete_reference_image
1944
+ ##
1945
+ # RPC-specific configuration for `list_reference_images`
1946
+ # @return [Gapic::Config::Method]
1947
+ #
1948
+ attr_reader :list_reference_images
1949
+ ##
1950
+ # RPC-specific configuration for `get_reference_image`
1951
+ # @return [Gapic::Config::Method]
1952
+ #
1953
+ attr_reader :get_reference_image
1954
+ ##
1955
+ # RPC-specific configuration for `add_product_to_product_set`
1956
+ # @return [Gapic::Config::Method]
1957
+ #
1958
+ attr_reader :add_product_to_product_set
1959
+ ##
1960
+ # RPC-specific configuration for `remove_product_from_product_set`
1961
+ # @return [Gapic::Config::Method]
1962
+ #
1963
+ attr_reader :remove_product_from_product_set
1964
+ ##
1965
+ # RPC-specific configuration for `list_products_in_product_set`
1966
+ # @return [Gapic::Config::Method]
1967
+ #
1968
+ attr_reader :list_products_in_product_set
1969
+ ##
1970
+ # RPC-specific configuration for `import_product_sets`
1971
+ # @return [Gapic::Config::Method]
1972
+ #
1973
+ attr_reader :import_product_sets
1974
+
1975
+ # @private
1976
+ def initialize parent_rpcs = nil
1977
+ create_product_set_config = parent_rpcs&.create_product_set if parent_rpcs&.respond_to? :create_product_set
1978
+ @create_product_set = Gapic::Config::Method.new create_product_set_config
1979
+ list_product_sets_config = parent_rpcs&.list_product_sets if parent_rpcs&.respond_to? :list_product_sets
1980
+ @list_product_sets = Gapic::Config::Method.new list_product_sets_config
1981
+ get_product_set_config = parent_rpcs&.get_product_set if parent_rpcs&.respond_to? :get_product_set
1982
+ @get_product_set = Gapic::Config::Method.new get_product_set_config
1983
+ update_product_set_config = parent_rpcs&.update_product_set if parent_rpcs&.respond_to? :update_product_set
1984
+ @update_product_set = Gapic::Config::Method.new update_product_set_config
1985
+ delete_product_set_config = parent_rpcs&.delete_product_set if parent_rpcs&.respond_to? :delete_product_set
1986
+ @delete_product_set = Gapic::Config::Method.new delete_product_set_config
1987
+ create_product_config = parent_rpcs&.create_product if parent_rpcs&.respond_to? :create_product
1988
+ @create_product = Gapic::Config::Method.new create_product_config
1989
+ list_products_config = parent_rpcs&.list_products if parent_rpcs&.respond_to? :list_products
1990
+ @list_products = Gapic::Config::Method.new list_products_config
1991
+ get_product_config = parent_rpcs&.get_product if parent_rpcs&.respond_to? :get_product
1992
+ @get_product = Gapic::Config::Method.new get_product_config
1993
+ update_product_config = parent_rpcs&.update_product if parent_rpcs&.respond_to? :update_product
1994
+ @update_product = Gapic::Config::Method.new update_product_config
1995
+ delete_product_config = parent_rpcs&.delete_product if parent_rpcs&.respond_to? :delete_product
1996
+ @delete_product = Gapic::Config::Method.new delete_product_config
1997
+ create_reference_image_config = parent_rpcs&.create_reference_image if parent_rpcs&.respond_to? :create_reference_image
1998
+ @create_reference_image = Gapic::Config::Method.new create_reference_image_config
1999
+ delete_reference_image_config = parent_rpcs&.delete_reference_image if parent_rpcs&.respond_to? :delete_reference_image
2000
+ @delete_reference_image = Gapic::Config::Method.new delete_reference_image_config
2001
+ list_reference_images_config = parent_rpcs&.list_reference_images if parent_rpcs&.respond_to? :list_reference_images
2002
+ @list_reference_images = Gapic::Config::Method.new list_reference_images_config
2003
+ get_reference_image_config = parent_rpcs&.get_reference_image if parent_rpcs&.respond_to? :get_reference_image
2004
+ @get_reference_image = Gapic::Config::Method.new get_reference_image_config
2005
+ add_product_to_product_set_config = parent_rpcs&.add_product_to_product_set if parent_rpcs&.respond_to? :add_product_to_product_set
2006
+ @add_product_to_product_set = Gapic::Config::Method.new add_product_to_product_set_config
2007
+ remove_product_from_product_set_config = parent_rpcs&.remove_product_from_product_set if parent_rpcs&.respond_to? :remove_product_from_product_set
2008
+ @remove_product_from_product_set = Gapic::Config::Method.new remove_product_from_product_set_config
2009
+ list_products_in_product_set_config = parent_rpcs&.list_products_in_product_set if parent_rpcs&.respond_to? :list_products_in_product_set
2010
+ @list_products_in_product_set = Gapic::Config::Method.new list_products_in_product_set_config
2011
+ import_product_sets_config = parent_rpcs&.import_product_sets if parent_rpcs&.respond_to? :import_product_sets
2012
+ @import_product_sets = Gapic::Config::Method.new import_product_sets_config
2013
+
2014
+ yield self if block_given?
2015
+ end
2016
+ end
2017
+ end
2018
+ end
2019
+ end
2020
+ end
2021
+ end
2022
+ end
2023
+ end
2024
+
2025
+ # rubocop:disable Lint/HandleExceptions
2026
+
2027
+ # Once client is loaded, load helpers.rb if it exists.
2028
+ begin
2029
+ require "google/cloud/vision/v1p3beta1/product_search/helpers"
2030
+ rescue LoadError
2031
+ end
2032
+
2033
+ # rubocop:enable Lint/HandleExceptions