google-cloud-vision-v1p3beta1 0.8.0 → 0.9.0

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