google-cloud-retail-v2 0.3.2 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/retail/v2/catalog_pb.rb +2 -0
  3. data/lib/google/cloud/retail/v2/catalog_service/client.rb +240 -40
  4. data/lib/google/cloud/retail/v2/catalog_service/paths.rb +21 -0
  5. data/lib/google/cloud/retail/v2/catalog_service_pb.rb +16 -0
  6. data/lib/google/cloud/retail/v2/catalog_service_services_pb.rb +46 -0
  7. data/lib/google/cloud/retail/v2/common_pb.rb +46 -0
  8. data/lib/google/cloud/retail/v2/completion_service/client.rb +545 -0
  9. data/lib/google/cloud/retail/v2/completion_service/credentials.rb +51 -0
  10. data/lib/google/cloud/retail/v2/completion_service/operations.rb +664 -0
  11. data/lib/google/cloud/retail/v2/completion_service/paths.rb +52 -0
  12. data/lib/google/cloud/retail/v2/completion_service.rb +54 -0
  13. data/lib/google/cloud/retail/v2/completion_service_pb.rb +50 -0
  14. data/lib/google/cloud/retail/v2/completion_service_services_pb.rb +61 -0
  15. data/lib/google/cloud/retail/v2/import_config_pb.rb +32 -0
  16. data/lib/google/cloud/retail/v2/prediction_service/client.rb +66 -70
  17. data/lib/google/cloud/retail/v2/product_pb.rb +21 -0
  18. data/lib/google/cloud/retail/v2/product_service/client.rb +682 -43
  19. data/lib/google/cloud/retail/v2/product_service/operations.rb +30 -21
  20. data/lib/google/cloud/retail/v2/product_service_pb.rb +56 -0
  21. data/lib/google/cloud/retail/v2/product_service_services_pb.rb +75 -0
  22. data/lib/google/cloud/retail/v2/search_service/client.rb +552 -0
  23. data/lib/google/cloud/retail/v2/search_service/credentials.rb +51 -0
  24. data/lib/google/cloud/retail/v2/search_service/paths.rb +54 -0
  25. data/lib/google/cloud/retail/v2/search_service.rb +53 -0
  26. data/lib/google/cloud/retail/v2/search_service_pb.rb +133 -0
  27. data/lib/google/cloud/retail/v2/search_service_services_pb.rb +53 -0
  28. data/lib/google/cloud/retail/v2/user_event_pb.rb +11 -0
  29. data/lib/google/cloud/retail/v2/user_event_service/client.rb +45 -42
  30. data/lib/google/cloud/retail/v2/user_event_service/operations.rb +30 -21
  31. data/lib/google/cloud/retail/v2/user_event_service/paths.rb +19 -0
  32. data/lib/google/cloud/retail/v2/version.rb +1 -1
  33. data/lib/google/cloud/retail/v2.rb +2 -0
  34. data/proto_docs/google/cloud/retail/v2/catalog.rb +6 -6
  35. data/proto_docs/google/cloud/retail/v2/catalog_service.rb +53 -4
  36. data/proto_docs/google/cloud/retail/v2/common.rb +272 -4
  37. data/proto_docs/google/cloud/retail/v2/completion_service.rb +164 -0
  38. data/proto_docs/google/cloud/retail/v2/import_config.rb +122 -6
  39. data/proto_docs/google/cloud/retail/v2/prediction_service.rb +32 -31
  40. data/proto_docs/google/cloud/retail/v2/product.rb +265 -9
  41. data/proto_docs/google/cloud/retail/v2/product_service.rb +362 -2
  42. data/proto_docs/google/cloud/retail/v2/purge_config.rb +1 -1
  43. data/proto_docs/google/cloud/retail/v2/search_service.rb +711 -0
  44. data/proto_docs/google/cloud/retail/v2/user_event.rb +110 -6
  45. data/proto_docs/google/type/date.rb +53 -0
  46. metadata +20 -4
@@ -7,6 +7,7 @@ require 'google/api/annotations_pb'
7
7
  require 'google/api/field_behavior_pb'
8
8
  require 'google/api/resource_pb'
9
9
  require 'google/cloud/retail/v2/common_pb'
10
+ require 'google/protobuf/duration_pb'
10
11
  require 'google/protobuf/field_mask_pb'
11
12
  require 'google/protobuf/timestamp_pb'
12
13
  require 'google/protobuf/wrappers_pb'
@@ -17,17 +18,37 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
17
18
  optional :id, :string, 2
18
19
  optional :type, :enum, 3, "google.cloud.retail.v2.Product.Type"
19
20
  optional :primary_product_id, :string, 4
21
+ repeated :collection_member_ids, :string, 5
22
+ optional :gtin, :string, 6
20
23
  repeated :categories, :string, 7
21
24
  optional :title, :string, 8
25
+ repeated :brands, :string, 9
22
26
  optional :description, :string, 10
27
+ optional :language_code, :string, 11
23
28
  map :attributes, :string, :message, 12, "google.cloud.retail.v2.CustomAttribute"
24
29
  repeated :tags, :string, 13
25
30
  optional :price_info, :message, 14, "google.cloud.retail.v2.PriceInfo"
31
+ optional :rating, :message, 15, "google.cloud.retail.v2.Rating"
26
32
  optional :available_time, :message, 18, "google.protobuf.Timestamp"
27
33
  optional :availability, :enum, 19, "google.cloud.retail.v2.Product.Availability"
28
34
  optional :available_quantity, :message, 20, "google.protobuf.Int32Value"
35
+ repeated :fulfillment_info, :message, 21, "google.cloud.retail.v2.FulfillmentInfo"
29
36
  optional :uri, :string, 22
30
37
  repeated :images, :message, 23, "google.cloud.retail.v2.Image"
38
+ optional :audience, :message, 24, "google.cloud.retail.v2.Audience"
39
+ optional :color_info, :message, 25, "google.cloud.retail.v2.ColorInfo"
40
+ repeated :sizes, :string, 26
41
+ repeated :materials, :string, 27
42
+ repeated :patterns, :string, 28
43
+ repeated :conditions, :string, 29
44
+ repeated :promotions, :message, 34, "google.cloud.retail.v2.Promotion"
45
+ optional :publish_time, :message, 33, "google.protobuf.Timestamp"
46
+ optional :retrievable_fields, :message, 30, "google.protobuf.FieldMask"
47
+ repeated :variants, :message, 31, "google.cloud.retail.v2.Product"
48
+ oneof :expiration do
49
+ optional :expire_time, :message, 16, "google.protobuf.Timestamp"
50
+ optional :ttl, :message, 17, "google.protobuf.Duration"
51
+ end
31
52
  end
32
53
  add_enum "google.cloud.retail.v2.Product.Type" do
33
54
  value :TYPE_UNSPECIFIED, 0
@@ -42,13 +42,12 @@ module Google
42
42
  # See {::Google::Cloud::Retail::V2::ProductService::Client::Configuration}
43
43
  # for a description of the configuration fields.
44
44
  #
45
- # ## Example
45
+ # @example
46
46
  #
47
- # To modify the configuration for all ProductService clients:
48
- #
49
- # ::Google::Cloud::Retail::V2::ProductService::Client.configure do |config|
50
- # config.timeout = 10.0
51
- # end
47
+ # # Modify the configuration for all ProductService clients
48
+ # ::Google::Cloud::Retail::V2::ProductService::Client.configure do |config|
49
+ # config.timeout = 10.0
50
+ # end
52
51
  #
53
52
  # @yield [config] Configure the Client client.
54
53
  # @yieldparam config [Client::Configuration]
@@ -100,19 +99,15 @@ module Google
100
99
  ##
101
100
  # Create a new ProductService client object.
102
101
  #
103
- # ## Examples
104
- #
105
- # To create a new ProductService client with the default
106
- # configuration:
102
+ # @example
107
103
  #
108
- # client = ::Google::Cloud::Retail::V2::ProductService::Client.new
104
+ # # Create a client using the default configuration
105
+ # client = ::Google::Cloud::Retail::V2::ProductService::Client.new
109
106
  #
110
- # To create a new ProductService client with a custom
111
- # configuration:
112
- #
113
- # client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config|
114
- # config.timeout = 10.0
115
- # end
107
+ # # Create a client using a custom configuration
108
+ # client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config|
109
+ # config.timeout = 10.0
110
+ # end
116
111
  #
117
112
  # @yield [config] Configure the ProductService client.
118
113
  # @yieldparam config [Client::Configuration]
@@ -132,10 +127,9 @@ module Google
132
127
 
133
128
  # Create credentials
134
129
  credentials = @config.credentials
135
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
130
+ # Use self-signed JWT if the endpoint is unchanged from default,
136
131
  # but only if the default endpoint does not have a region prefix.
137
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
138
- @config.endpoint == Client.configure.endpoint &&
132
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
139
133
  !@config.endpoint.split(".").first.include?("-")
140
134
  credentials ||= Credentials.default scope: @config.scope,
141
135
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -242,7 +236,9 @@ module Google
242
236
  options.apply_defaults timeout: @config.rpcs.create_product.timeout,
243
237
  metadata: metadata,
244
238
  retry_policy: @config.rpcs.create_product.retry_policy
245
- options.apply_defaults metadata: @config.metadata,
239
+
240
+ options.apply_defaults timeout: @config.timeout,
241
+ metadata: @config.metadata,
246
242
  retry_policy: @config.retry_policy
247
243
 
248
244
  @product_service_stub.call_rpc :create_product, request, options: options do |response, operation|
@@ -317,7 +313,9 @@ module Google
317
313
  options.apply_defaults timeout: @config.rpcs.get_product.timeout,
318
314
  metadata: metadata,
319
315
  retry_policy: @config.rpcs.get_product.retry_policy
320
- options.apply_defaults metadata: @config.metadata,
316
+
317
+ options.apply_defaults timeout: @config.timeout,
318
+ metadata: @config.metadata,
321
319
  retry_policy: @config.retry_policy
322
320
 
323
321
  @product_service_stub.call_rpc :get_product, request, options: options do |response, operation|
@@ -328,6 +326,146 @@ module Google
328
326
  raise ::Google::Cloud::Error.from_error(e)
329
327
  end
330
328
 
329
+ ##
330
+ # Gets a list of {::Google::Cloud::Retail::V2::Product Product}s.
331
+ #
332
+ # @overload list_products(request, options = nil)
333
+ # Pass arguments to `list_products` via a request object, either of type
334
+ # {::Google::Cloud::Retail::V2::ListProductsRequest} or an equivalent Hash.
335
+ #
336
+ # @param request [::Google::Cloud::Retail::V2::ListProductsRequest, ::Hash]
337
+ # A request object representing the call parameters. Required. To specify no
338
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
339
+ # @param options [::Gapic::CallOptions, ::Hash]
340
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
341
+ #
342
+ # @overload list_products(parent: nil, page_size: nil, page_token: nil, filter: nil, read_mask: nil)
343
+ # Pass arguments to `list_products` via keyword arguments. Note that at
344
+ # least one keyword argument is required. To specify no parameters, or to keep all
345
+ # the default parameter values, pass an empty Hash as a request object (see above).
346
+ #
347
+ # @param parent [::String]
348
+ # Required. The parent branch resource name, such as
349
+ # `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
350
+ # `default_branch` as the branch ID, to list products under the default
351
+ # branch.
352
+ #
353
+ # If the caller does not have permission to list
354
+ # {::Google::Cloud::Retail::V2::Product Product}s under this branch, regardless of
355
+ # whether or not this branch exists, a PERMISSION_DENIED error is returned.
356
+ # @param page_size [::Integer]
357
+ # Maximum number of {::Google::Cloud::Retail::V2::Product Product}s to return. If
358
+ # unspecified, defaults to 100. The maximum allowed value is 1000. Values
359
+ # above 1000 will be coerced to 1000.
360
+ #
361
+ # If this field is negative, an INVALID_ARGUMENT error is returned.
362
+ # @param page_token [::String]
363
+ # A page token
364
+ # {::Google::Cloud::Retail::V2::ListProductsResponse#next_page_token ListProductsResponse.next_page_token},
365
+ # received from a previous
366
+ # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts}
367
+ # call. Provide this to retrieve the subsequent page.
368
+ #
369
+ # When paginating, all other parameters provided to
370
+ # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts}
371
+ # must match the call that provided the page token. Otherwise, an
372
+ # INVALID_ARGUMENT error is returned.
373
+ # @param filter [::String]
374
+ # A filter to apply on the list results. Supported features:
375
+ #
376
+ # * List all the products under the parent branch if
377
+ # {::Google::Cloud::Retail::V2::ListProductsRequest#filter filter} is unset.
378
+ # * List {::Google::Cloud::Retail::V2::Product::Type::VARIANT Product.Type.VARIANT}
379
+ # {::Google::Cloud::Retail::V2::Product Product}s sharing the same
380
+ # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY}
381
+ # {::Google::Cloud::Retail::V2::Product Product}. For example:
382
+ # `primary_product_id = "some_product_id"`
383
+ # * List {::Google::Cloud::Retail::V2::Product Product}s bundled in a
384
+ # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION}
385
+ # {::Google::Cloud::Retail::V2::Product Product}.
386
+ # For example:
387
+ # `collection_product_id = "some_product_id"`
388
+ # * List {::Google::Cloud::Retail::V2::Product Product}s with a partibular type.
389
+ # For example:
390
+ # `type = "PRIMARY"`
391
+ # `type = "VARIANT"`
392
+ # `type = "COLLECTION"`
393
+ #
394
+ # If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
395
+ #
396
+ # If the specified
397
+ # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY}
398
+ # {::Google::Cloud::Retail::V2::Product Product} or
399
+ # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION}
400
+ # {::Google::Cloud::Retail::V2::Product Product} does not exist, a NOT_FOUND error
401
+ # is returned.
402
+ # @param read_mask [::Google::Protobuf::FieldMask, ::Hash]
403
+ # The fields of {::Google::Cloud::Retail::V2::Product Product} to return in the
404
+ # responses. If not set or empty, the following fields are returned:
405
+ #
406
+ # * {::Google::Cloud::Retail::V2::Product#name Product.name}
407
+ # * {::Google::Cloud::Retail::V2::Product#id Product.id}
408
+ # * {::Google::Cloud::Retail::V2::Product#title Product.title}
409
+ # * {::Google::Cloud::Retail::V2::Product#uri Product.uri}
410
+ # * {::Google::Cloud::Retail::V2::Product#images Product.images}
411
+ # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info}
412
+ # * {::Google::Cloud::Retail::V2::Product#brands Product.brands}
413
+ #
414
+ # If "*" is provided, all fields are returned.
415
+ # {::Google::Cloud::Retail::V2::Product#name Product.name} is always returned no
416
+ # matter what mask is set.
417
+ #
418
+ # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
419
+ # is returned.
420
+ #
421
+ # @yield [response, operation] Access the result along with the RPC operation
422
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::Product>]
423
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
424
+ #
425
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::Product>]
426
+ #
427
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
428
+ #
429
+ def list_products request, options = nil
430
+ raise ::ArgumentError, "request must be provided" if request.nil?
431
+
432
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListProductsRequest
433
+
434
+ # Converts hash and nil to an options object
435
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
436
+
437
+ # Customize the options with defaults
438
+ metadata = @config.rpcs.list_products.metadata.to_h
439
+
440
+ # Set x-goog-api-client and x-goog-user-project headers
441
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
442
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
443
+ gapic_version: ::Google::Cloud::Retail::V2::VERSION
444
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
445
+
446
+ header_params = {
447
+ "parent" => request.parent
448
+ }
449
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
450
+ metadata[:"x-goog-request-params"] ||= request_params_header
451
+
452
+ options.apply_defaults timeout: @config.rpcs.list_products.timeout,
453
+ metadata: metadata,
454
+ retry_policy: @config.rpcs.list_products.retry_policy
455
+
456
+ options.apply_defaults timeout: @config.timeout,
457
+ metadata: @config.metadata,
458
+ retry_policy: @config.retry_policy
459
+
460
+ @product_service_stub.call_rpc :list_products, request, options: options do |response, operation|
461
+ response = ::Gapic::PagedEnumerable.new @product_service_stub, :list_products, 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
+
331
469
  ##
332
470
  # Updates a {::Google::Cloud::Retail::V2::Product Product}.
333
471
  #
@@ -341,7 +479,7 @@ module Google
341
479
  # @param options [::Gapic::CallOptions, ::Hash]
342
480
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
343
481
  #
344
- # @overload update_product(product: nil, update_mask: nil)
482
+ # @overload update_product(product: nil, update_mask: nil, allow_missing: nil)
345
483
  # Pass arguments to `update_product` via keyword arguments. Note that at
346
484
  # least one keyword argument is required. To specify no parameters, or to keep all
347
485
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -353,8 +491,10 @@ module Google
353
491
  # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it
354
492
  # exists, a PERMISSION_DENIED error is returned.
355
493
  #
356
- # If the {::Google::Cloud::Retail::V2::Product Product} to update does not exist,
357
- # a NOT_FOUND error is returned.
494
+ # If the {::Google::Cloud::Retail::V2::Product Product} to update does not exist
495
+ # and
496
+ # {::Google::Cloud::Retail::V2::UpdateProductRequest#allow_missing allow_missing}
497
+ # is not set, a NOT_FOUND error is returned.
358
498
  # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
359
499
  # Indicates which fields in the provided
360
500
  # {::Google::Cloud::Retail::V2::Product Product} to update. The immutable and
@@ -363,6 +503,10 @@ module Google
363
503
  #
364
504
  # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
365
505
  # is returned.
506
+ # @param allow_missing [::Boolean]
507
+ # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not
508
+ # found, a new {::Google::Cloud::Retail::V2::Product Product} will be created. In
509
+ # this situation, `update_mask` is ignored.
366
510
  #
367
511
  # @yield [response, operation] Access the result along with the RPC operation
368
512
  # @yieldparam response [::Google::Cloud::Retail::V2::Product]
@@ -398,7 +542,9 @@ module Google
398
542
  options.apply_defaults timeout: @config.rpcs.update_product.timeout,
399
543
  metadata: metadata,
400
544
  retry_policy: @config.rpcs.update_product.retry_policy
401
- options.apply_defaults metadata: @config.metadata,
545
+
546
+ options.apply_defaults timeout: @config.timeout,
547
+ metadata: @config.metadata,
402
548
  retry_policy: @config.retry_policy
403
549
 
404
550
  @product_service_stub.call_rpc :update_product, request, options: options do |response, operation|
@@ -439,6 +585,17 @@ module Google
439
585
  # If the {::Google::Cloud::Retail::V2::Product Product} to delete does not exist,
440
586
  # a NOT_FOUND error is returned.
441
587
  #
588
+ # The {::Google::Cloud::Retail::V2::Product Product} to delete can neither be a
589
+ # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION}
590
+ # {::Google::Cloud::Retail::V2::Product Product} member nor a
591
+ # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY}
592
+ # {::Google::Cloud::Retail::V2::Product Product} with more than one
593
+ # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variants}. Otherwise, an
594
+ # INVALID_ARGUMENT error is returned.
595
+ #
596
+ # All inventory information for the named
597
+ # {::Google::Cloud::Retail::V2::Product Product} will be deleted.
598
+ #
442
599
  # @yield [response, operation] Access the result along with the RPC operation
443
600
  # @yieldparam response [::Google::Protobuf::Empty]
444
601
  # @yieldparam operation [::GRPC::ActiveCall::Operation]
@@ -473,7 +630,9 @@ module Google
473
630
  options.apply_defaults timeout: @config.rpcs.delete_product.timeout,
474
631
  metadata: metadata,
475
632
  retry_policy: @config.rpcs.delete_product.retry_policy
476
- options.apply_defaults metadata: @config.metadata,
633
+
634
+ options.apply_defaults timeout: @config.timeout,
635
+ metadata: @config.metadata,
477
636
  retry_policy: @config.retry_policy
478
637
 
479
638
  @product_service_stub.call_rpc :delete_product, request, options: options do |response, operation|
@@ -503,7 +662,7 @@ module Google
503
662
  # @param options [::Gapic::CallOptions, ::Hash]
504
663
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
505
664
  #
506
- # @overload import_products(parent: nil, input_config: nil, errors_config: nil, update_mask: nil)
665
+ # @overload import_products(parent: nil, request_id: nil, input_config: nil, errors_config: nil, update_mask: nil, reconciliation_mode: nil, notification_pubsub_topic: nil)
507
666
  # Pass arguments to `import_products` via keyword arguments. Note that at
508
667
  # least one keyword argument is required. To specify no parameters, or to keep all
509
668
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -514,6 +673,16 @@ module Google
514
673
  #
515
674
  # If no updateMask is specified, requires products.create permission.
516
675
  # If updateMask is specified, requires products.update permission.
676
+ # @param request_id [::String]
677
+ # Unique identifier provided by client, within the ancestor
678
+ # dataset scope. Ensures idempotency and used for request deduplication.
679
+ # Server-generated if unspecified. Up to 128 characters long and must match
680
+ # the pattern: "[a-zA-Z0-9_]+". This is returned as [Operation.name][] in
681
+ # {::Google::Cloud::Retail::V2::ImportMetadata ImportMetadata}.
682
+ #
683
+ # Only supported when
684
+ # {::Google::Cloud::Retail::V2::ImportProductsRequest#reconciliation_mode ImportProductsRequest.reconciliation_mode}
685
+ # is set to `FULL`.
517
686
  # @param input_config [::Google::Cloud::Retail::V2::ProductInputConfig, ::Hash]
518
687
  # Required. The desired input location of the data.
519
688
  # @param errors_config [::Google::Cloud::Retail::V2::ImportErrorsConfig, ::Hash]
@@ -521,6 +690,20 @@ module Google
521
690
  # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
522
691
  # Indicates which fields in the provided imported 'products' to update. If
523
692
  # not set, will by default update all fields.
693
+ # @param reconciliation_mode [::Google::Cloud::Retail::V2::ImportProductsRequest::ReconciliationMode]
694
+ # The mode of reconciliation between existing products and the products to be
695
+ # imported. Defaults to
696
+ # {::Google::Cloud::Retail::V2::ImportProductsRequest::ReconciliationMode::INCREMENTAL ReconciliationMode.INCREMENTAL}.
697
+ # @param notification_pubsub_topic [::String]
698
+ # Pub/Sub topic for receiving notification. If this field is set,
699
+ # when the import is finished, a notification will be sent to
700
+ # specified Pub/Sub topic. The message data will be JSON string of a
701
+ # {::Google::Longrunning::Operation Operation}.
702
+ # Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
703
+ #
704
+ # Only supported when
705
+ # {::Google::Cloud::Retail::V2::ImportProductsRequest#reconciliation_mode ImportProductsRequest.reconciliation_mode}
706
+ # is set to `FULL`.
524
707
  #
525
708
  # @yield [response, operation] Access the result along with the RPC operation
526
709
  # @yieldparam response [::Gapic::Operation]
@@ -556,7 +739,9 @@ module Google
556
739
  options.apply_defaults timeout: @config.rpcs.import_products.timeout,
557
740
  metadata: metadata,
558
741
  retry_policy: @config.rpcs.import_products.retry_policy
559
- options.apply_defaults metadata: @config.metadata,
742
+
743
+ options.apply_defaults timeout: @config.timeout,
744
+ metadata: @config.metadata,
560
745
  retry_policy: @config.retry_policy
561
746
 
562
747
  @product_service_stub.call_rpc :import_products, request, options: options do |response, operation|
@@ -568,6 +753,433 @@ module Google
568
753
  raise ::Google::Cloud::Error.from_error(e)
569
754
  end
570
755
 
756
+ ##
757
+ # Updates inventory information for a
758
+ # {::Google::Cloud::Retail::V2::Product Product} while respecting the last update
759
+ # timestamps of each inventory field.
760
+ #
761
+ # This process is asynchronous and does not require the
762
+ # {::Google::Cloud::Retail::V2::Product Product} to exist before updating
763
+ # fulfillment information. If the request is valid, the update will be
764
+ # enqueued and processed downstream. As a consequence, when a response is
765
+ # returned, updates are not immediately manifested in the
766
+ # {::Google::Cloud::Retail::V2::Product Product} queried by
767
+ # {::Google::Cloud::Retail::V2::ProductService::Client#get_product GetProduct} or
768
+ # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ListProducts}.
769
+ #
770
+ # When inventory is updated with
771
+ # {::Google::Cloud::Retail::V2::ProductService::Client#create_product CreateProduct} and
772
+ # {::Google::Cloud::Retail::V2::ProductService::Client#update_product UpdateProduct}, the
773
+ # specified inventory field value(s) will overwrite any existing value(s)
774
+ # while ignoring the last update time for this field. Furthermore, the last
775
+ # update time for the specified inventory fields will be overwritten to the
776
+ # time of the
777
+ # {::Google::Cloud::Retail::V2::ProductService::Client#create_product CreateProduct} or
778
+ # {::Google::Cloud::Retail::V2::ProductService::Client#update_product UpdateProduct}
779
+ # request.
780
+ #
781
+ # If no inventory fields are set in
782
+ # {::Google::Cloud::Retail::V2::CreateProductRequest#product CreateProductRequest.product},
783
+ # then any pre-existing inventory information for this product will be used.
784
+ #
785
+ # If no inventory fields are set in [UpdateProductRequest.set_mask][],
786
+ # then any existing inventory information will be preserved.
787
+ #
788
+ # Pre-existing inventory information can only be updated with
789
+ # {::Google::Cloud::Retail::V2::ProductService::Client#set_inventory SetInventory},
790
+ # {::Google::Cloud::Retail::V2::ProductService::Client#add_fulfillment_places AddFulfillmentPlaces},
791
+ # and
792
+ # {::Google::Cloud::Retail::V2::ProductService::Client#remove_fulfillment_places RemoveFulfillmentPlaces}.
793
+ #
794
+ # This feature is only available for users who have Retail Search enabled.
795
+ # Please submit a form [here](https://cloud.google.com/contact) to contact
796
+ # cloud sales if you are interested in using Retail Search.
797
+ #
798
+ # @overload set_inventory(request, options = nil)
799
+ # Pass arguments to `set_inventory` via a request object, either of type
800
+ # {::Google::Cloud::Retail::V2::SetInventoryRequest} or an equivalent Hash.
801
+ #
802
+ # @param request [::Google::Cloud::Retail::V2::SetInventoryRequest, ::Hash]
803
+ # A request object representing the call parameters. Required. To specify no
804
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
805
+ # @param options [::Gapic::CallOptions, ::Hash]
806
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
807
+ #
808
+ # @overload set_inventory(inventory: nil, set_mask: nil, set_time: nil, allow_missing: nil)
809
+ # Pass arguments to `set_inventory` via keyword arguments. Note that at
810
+ # least one keyword argument is required. To specify no parameters, or to keep all
811
+ # the default parameter values, pass an empty Hash as a request object (see above).
812
+ #
813
+ # @param inventory [::Google::Cloud::Retail::V2::Product, ::Hash]
814
+ # Required. The inventory information to update. The allowable fields to
815
+ # update are:
816
+ # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info}
817
+ # * {::Google::Cloud::Retail::V2::Product#availability Product.availability}
818
+ # * {::Google::Cloud::Retail::V2::Product#available_quantity Product.available_quantity}
819
+ # * {::Google::Cloud::Retail::V2::Product#fulfillment_info Product.fulfillment_info}
820
+ # The updated inventory fields must be specified in
821
+ # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask}.
822
+ #
823
+ # If [SetInventoryRequest.inventory.name][] is empty or invalid, an
824
+ # INVALID_ARGUMENT error is returned.
825
+ #
826
+ # If the caller does not have permission to update the
827
+ # {::Google::Cloud::Retail::V2::Product Product} named in
828
+ # {::Google::Cloud::Retail::V2::Product#name Product.name}, regardless of whether
829
+ # or not it exists, a PERMISSION_DENIED error is returned.
830
+ #
831
+ # If the {::Google::Cloud::Retail::V2::Product Product} to update does not have
832
+ # existing inventory information, the provided inventory information will be
833
+ # inserted.
834
+ #
835
+ # If the {::Google::Cloud::Retail::V2::Product Product} to update has existing
836
+ # inventory information, the provided inventory information will be merged
837
+ # while respecting the last update time for each inventory field, using the
838
+ # provided or default value for
839
+ # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_time SetInventoryRequest.set_time}.
840
+ #
841
+ # The last update time is recorded for the following inventory fields:
842
+ # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info}
843
+ # * {::Google::Cloud::Retail::V2::Product#availability Product.availability}
844
+ # * {::Google::Cloud::Retail::V2::Product#available_quantity Product.available_quantity}
845
+ # * {::Google::Cloud::Retail::V2::Product#fulfillment_info Product.fulfillment_info}
846
+ #
847
+ # If a full overwrite of inventory information while ignoring timestamps is
848
+ # needed, [UpdateProduct][] should be invoked instead.
849
+ # @param set_mask [::Google::Protobuf::FieldMask, ::Hash]
850
+ # Indicates which inventory fields in the provided
851
+ # {::Google::Cloud::Retail::V2::Product Product} to update. If not set or set with
852
+ # empty paths, all inventory fields will be updated.
853
+ #
854
+ # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
855
+ # is returned and the entire update will be ignored.
856
+ # @param set_time [::Google::Protobuf::Timestamp, ::Hash]
857
+ # The time when the request is issued, used to prevent
858
+ # out-of-order updates on inventory fields with the last update time
859
+ # recorded. If not provided, the internal system time will be used.
860
+ # @param allow_missing [::Boolean]
861
+ # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} with name
862
+ # {::Google::Cloud::Retail::V2::Product#name Product.name} is not found, the
863
+ # inventory update will still be processed and retained for at most 1 day
864
+ # until the {::Google::Cloud::Retail::V2::Product Product} is created. If set to
865
+ # false, an INVALID_ARGUMENT error is returned if the
866
+ # {::Google::Cloud::Retail::V2::Product Product} is not found.
867
+ #
868
+ # @yield [response, operation] Access the result along with the RPC operation
869
+ # @yieldparam response [::Gapic::Operation]
870
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
871
+ #
872
+ # @return [::Gapic::Operation]
873
+ #
874
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
875
+ #
876
+ def set_inventory request, options = nil
877
+ raise ::ArgumentError, "request must be provided" if request.nil?
878
+
879
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::SetInventoryRequest
880
+
881
+ # Converts hash and nil to an options object
882
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
883
+
884
+ # Customize the options with defaults
885
+ metadata = @config.rpcs.set_inventory.metadata.to_h
886
+
887
+ # Set x-goog-api-client and x-goog-user-project headers
888
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
889
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
890
+ gapic_version: ::Google::Cloud::Retail::V2::VERSION
891
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
892
+
893
+ header_params = {
894
+ "inventory.name" => request.inventory.name
895
+ }
896
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
897
+ metadata[:"x-goog-request-params"] ||= request_params_header
898
+
899
+ options.apply_defaults timeout: @config.rpcs.set_inventory.timeout,
900
+ metadata: metadata,
901
+ retry_policy: @config.rpcs.set_inventory.retry_policy
902
+
903
+ options.apply_defaults timeout: @config.timeout,
904
+ metadata: @config.metadata,
905
+ retry_policy: @config.retry_policy
906
+
907
+ @product_service_stub.call_rpc :set_inventory, request, options: options do |response, operation|
908
+ response = ::Gapic::Operation.new response, @operations_client, options: options
909
+ yield response, operation if block_given?
910
+ return response
911
+ end
912
+ rescue ::GRPC::BadStatus => e
913
+ raise ::Google::Cloud::Error.from_error(e)
914
+ end
915
+
916
+ ##
917
+ # Incrementally adds place IDs to
918
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids Product.fulfillment_info.place_ids}.
919
+ #
920
+ # This process is asynchronous and does not require the
921
+ # {::Google::Cloud::Retail::V2::Product Product} to exist before updating
922
+ # fulfillment information. If the request is valid, the update will be
923
+ # enqueued and processed downstream. As a consequence, when a response is
924
+ # returned, the added place IDs are not immediately manifested in the
925
+ # {::Google::Cloud::Retail::V2::Product Product} queried by
926
+ # {::Google::Cloud::Retail::V2::ProductService::Client#get_product GetProduct} or
927
+ # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ListProducts}.
928
+ #
929
+ # This feature is only available for users who have Retail Search enabled.
930
+ # Please submit a form [here](https://cloud.google.com/contact) to contact
931
+ # cloud sales if you are interested in using Retail Search.
932
+ #
933
+ # @overload add_fulfillment_places(request, options = nil)
934
+ # Pass arguments to `add_fulfillment_places` via a request object, either of type
935
+ # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest} or an equivalent Hash.
936
+ #
937
+ # @param request [::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest, ::Hash]
938
+ # A request object representing the call parameters. Required. To specify no
939
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
940
+ # @param options [::Gapic::CallOptions, ::Hash]
941
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
942
+ #
943
+ # @overload add_fulfillment_places(product: nil, type: nil, place_ids: nil, add_time: nil, allow_missing: nil)
944
+ # Pass arguments to `add_fulfillment_places` via keyword arguments. Note that at
945
+ # least one keyword argument is required. To specify no parameters, or to keep all
946
+ # the default parameter values, pass an empty Hash as a request object (see above).
947
+ #
948
+ # @param product [::String]
949
+ # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product},
950
+ # such as
951
+ # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
952
+ #
953
+ # If the caller does not have permission to access the
954
+ # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it
955
+ # exists, a PERMISSION_DENIED error is returned.
956
+ # @param type [::String]
957
+ # Required. The fulfillment type, including commonly used types (such as
958
+ # pickup in store and same day delivery), and custom types.
959
+ #
960
+ # Supported values:
961
+ #
962
+ # * "pickup-in-store"
963
+ # * "ship-to-store"
964
+ # * "same-day-delivery"
965
+ # * "next-day-delivery"
966
+ # * "custom-type-1"
967
+ # * "custom-type-2"
968
+ # * "custom-type-3"
969
+ # * "custom-type-4"
970
+ # * "custom-type-5"
971
+ #
972
+ # If this field is set to an invalid value other than these, an
973
+ # INVALID_ARGUMENT error is returned.
974
+ #
975
+ # This field directly corresponds to [Product.fulfillment_info.type][].
976
+ # @param place_ids [::Array<::String>]
977
+ # Required. The IDs for this
978
+ # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type}, such as
979
+ # the store IDs for "pickup-in-store" or the region IDs for
980
+ # "same-day-delivery" to be added for this
981
+ # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type}. Duplicate
982
+ # IDs will be automatically ignored.
983
+ #
984
+ # At least 1 value is required, and a maximum of 2000 values are allowed.
985
+ # Each value must be a string with a length limit of 10 characters, matching
986
+ # the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
987
+ # INVALID_ARGUMENT error is returned.
988
+ #
989
+ # If the total number of place IDs exceeds 2000 for this
990
+ # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type} after
991
+ # adding, then the update will be rejected.
992
+ # @param add_time [::Google::Protobuf::Timestamp, ::Hash]
993
+ # The time when the fulfillment updates are issued, used to prevent
994
+ # out-of-order updates on fulfillment information. If not provided, the
995
+ # internal system time will be used.
996
+ # @param allow_missing [::Boolean]
997
+ # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not
998
+ # found, the fulfillment information will still be processed and retained for
999
+ # at most 1 day and processed once the
1000
+ # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, an
1001
+ # INVALID_ARGUMENT error is returned if the
1002
+ # {::Google::Cloud::Retail::V2::Product Product} is not found.
1003
+ #
1004
+ # @yield [response, operation] Access the result along with the RPC operation
1005
+ # @yieldparam response [::Gapic::Operation]
1006
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1007
+ #
1008
+ # @return [::Gapic::Operation]
1009
+ #
1010
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1011
+ #
1012
+ def add_fulfillment_places request, options = nil
1013
+ raise ::ArgumentError, "request must be provided" if request.nil?
1014
+
1015
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest
1016
+
1017
+ # Converts hash and nil to an options object
1018
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1019
+
1020
+ # Customize the options with defaults
1021
+ metadata = @config.rpcs.add_fulfillment_places.metadata.to_h
1022
+
1023
+ # Set x-goog-api-client and x-goog-user-project headers
1024
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1025
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1026
+ gapic_version: ::Google::Cloud::Retail::V2::VERSION
1027
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1028
+
1029
+ header_params = {
1030
+ "product" => request.product
1031
+ }
1032
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1033
+ metadata[:"x-goog-request-params"] ||= request_params_header
1034
+
1035
+ options.apply_defaults timeout: @config.rpcs.add_fulfillment_places.timeout,
1036
+ metadata: metadata,
1037
+ retry_policy: @config.rpcs.add_fulfillment_places.retry_policy
1038
+
1039
+ options.apply_defaults timeout: @config.timeout,
1040
+ metadata: @config.metadata,
1041
+ retry_policy: @config.retry_policy
1042
+
1043
+ @product_service_stub.call_rpc :add_fulfillment_places, request, options: options do |response, operation|
1044
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1045
+ yield response, operation if block_given?
1046
+ return response
1047
+ end
1048
+ rescue ::GRPC::BadStatus => e
1049
+ raise ::Google::Cloud::Error.from_error(e)
1050
+ end
1051
+
1052
+ ##
1053
+ # Incrementally removes place IDs from a
1054
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids Product.fulfillment_info.place_ids}.
1055
+ #
1056
+ # This process is asynchronous and does not require the
1057
+ # {::Google::Cloud::Retail::V2::Product Product} to exist before updating
1058
+ # fulfillment information. If the request is valid, the update will be
1059
+ # enqueued and processed downstream. As a consequence, when a response is
1060
+ # returned, the removed place IDs are not immediately manifested in the
1061
+ # {::Google::Cloud::Retail::V2::Product Product} queried by
1062
+ # {::Google::Cloud::Retail::V2::ProductService::Client#get_product GetProduct} or
1063
+ # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ListProducts}.
1064
+ #
1065
+ # This feature is only available for users who have Retail Search enabled.
1066
+ # Please submit a form [here](https://cloud.google.com/contact) to contact
1067
+ # cloud sales if you are interested in using Retail Search.
1068
+ #
1069
+ # @overload remove_fulfillment_places(request, options = nil)
1070
+ # Pass arguments to `remove_fulfillment_places` via a request object, either of type
1071
+ # {::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest} or an equivalent Hash.
1072
+ #
1073
+ # @param request [::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest, ::Hash]
1074
+ # A request object representing the call parameters. Required. To specify no
1075
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1076
+ # @param options [::Gapic::CallOptions, ::Hash]
1077
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1078
+ #
1079
+ # @overload remove_fulfillment_places(product: nil, type: nil, place_ids: nil, remove_time: nil, allow_missing: nil)
1080
+ # Pass arguments to `remove_fulfillment_places` via keyword arguments. Note that at
1081
+ # least one keyword argument is required. To specify no parameters, or to keep all
1082
+ # the default parameter values, pass an empty Hash as a request object (see above).
1083
+ #
1084
+ # @param product [::String]
1085
+ # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product},
1086
+ # such as
1087
+ # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
1088
+ #
1089
+ # If the caller does not have permission to access the
1090
+ # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it
1091
+ # exists, a PERMISSION_DENIED error is returned.
1092
+ # @param type [::String]
1093
+ # Required. The fulfillment type, including commonly used types (such as
1094
+ # pickup in store and same day delivery), and custom types.
1095
+ #
1096
+ # Supported values:
1097
+ #
1098
+ # * "pickup-in-store"
1099
+ # * "ship-to-store"
1100
+ # * "same-day-delivery"
1101
+ # * "next-day-delivery"
1102
+ # * "custom-type-1"
1103
+ # * "custom-type-2"
1104
+ # * "custom-type-3"
1105
+ # * "custom-type-4"
1106
+ # * "custom-type-5"
1107
+ #
1108
+ # If this field is set to an invalid value other than these, an
1109
+ # INVALID_ARGUMENT error is returned.
1110
+ #
1111
+ # This field directly corresponds to [Product.fulfillment_info.type][].
1112
+ # @param place_ids [::Array<::String>]
1113
+ # Required. The IDs for this
1114
+ # {::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest#type type}, such as
1115
+ # the store IDs for "pickup-in-store" or the region IDs for
1116
+ # "same-day-delivery", to be removed for this
1117
+ # {::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest#type type}.
1118
+ #
1119
+ # At least 1 value is required, and a maximum of 2000 values are allowed.
1120
+ # Each value must be a string with a length limit of 10 characters, matching
1121
+ # the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
1122
+ # INVALID_ARGUMENT error is returned.
1123
+ # @param remove_time [::Google::Protobuf::Timestamp, ::Hash]
1124
+ # The time when the fulfillment updates are issued, used to prevent
1125
+ # out-of-order updates on fulfillment information. If not provided, the
1126
+ # internal system time will be used.
1127
+ # @param allow_missing [::Boolean]
1128
+ # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not
1129
+ # found, the fulfillment information will still be processed and retained for
1130
+ # at most 1 day and processed once the
1131
+ # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, an
1132
+ # INVALID_ARGUMENT error is returned if the
1133
+ # {::Google::Cloud::Retail::V2::Product Product} is not found.
1134
+ #
1135
+ # @yield [response, operation] Access the result along with the RPC operation
1136
+ # @yieldparam response [::Gapic::Operation]
1137
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1138
+ #
1139
+ # @return [::Gapic::Operation]
1140
+ #
1141
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1142
+ #
1143
+ def remove_fulfillment_places request, options = nil
1144
+ raise ::ArgumentError, "request must be provided" if request.nil?
1145
+
1146
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest
1147
+
1148
+ # Converts hash and nil to an options object
1149
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1150
+
1151
+ # Customize the options with defaults
1152
+ metadata = @config.rpcs.remove_fulfillment_places.metadata.to_h
1153
+
1154
+ # Set x-goog-api-client and x-goog-user-project headers
1155
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1156
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1157
+ gapic_version: ::Google::Cloud::Retail::V2::VERSION
1158
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1159
+
1160
+ header_params = {
1161
+ "product" => request.product
1162
+ }
1163
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1164
+ metadata[:"x-goog-request-params"] ||= request_params_header
1165
+
1166
+ options.apply_defaults timeout: @config.rpcs.remove_fulfillment_places.timeout,
1167
+ metadata: metadata,
1168
+ retry_policy: @config.rpcs.remove_fulfillment_places.retry_policy
1169
+
1170
+ options.apply_defaults timeout: @config.timeout,
1171
+ metadata: @config.metadata,
1172
+ retry_policy: @config.retry_policy
1173
+
1174
+ @product_service_stub.call_rpc :remove_fulfillment_places, request, options: options do |response, operation|
1175
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1176
+ yield response, operation if block_given?
1177
+ return response
1178
+ end
1179
+ rescue ::GRPC::BadStatus => e
1180
+ raise ::Google::Cloud::Error.from_error(e)
1181
+ end
1182
+
571
1183
  ##
572
1184
  # Configuration class for the ProductService API.
573
1185
  #
@@ -581,22 +1193,21 @@ module Google
581
1193
  # Configuration can be applied globally to all clients, or to a single client
582
1194
  # on construction.
583
1195
  #
584
- # # Examples
585
- #
586
- # To modify the global config, setting the timeout for create_product
587
- # to 20 seconds, and all remaining timeouts to 10 seconds:
1196
+ # @example
588
1197
  #
589
- # ::Google::Cloud::Retail::V2::ProductService::Client.configure do |config|
590
- # config.timeout = 10.0
591
- # config.rpcs.create_product.timeout = 20.0
592
- # end
1198
+ # # Modify the global config, setting the timeout for
1199
+ # # create_product to 20 seconds,
1200
+ # # and all remaining timeouts to 10 seconds.
1201
+ # ::Google::Cloud::Retail::V2::ProductService::Client.configure do |config|
1202
+ # config.timeout = 10.0
1203
+ # config.rpcs.create_product.timeout = 20.0
1204
+ # end
593
1205
  #
594
- # To apply the above configuration only to a new client:
595
- #
596
- # client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config|
597
- # config.timeout = 10.0
598
- # config.rpcs.create_product.timeout = 20.0
599
- # end
1206
+ # # Apply the above configuration only to a new client.
1207
+ # client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config|
1208
+ # config.timeout = 10.0
1209
+ # config.rpcs.create_product.timeout = 20.0
1210
+ # end
600
1211
  #
601
1212
  # @!attribute [rw] endpoint
602
1213
  # The hostname or hostname:port of the service endpoint.
@@ -715,6 +1326,11 @@ module Google
715
1326
  #
716
1327
  attr_reader :get_product
717
1328
  ##
1329
+ # RPC-specific configuration for `list_products`
1330
+ # @return [::Gapic::Config::Method]
1331
+ #
1332
+ attr_reader :list_products
1333
+ ##
718
1334
  # RPC-specific configuration for `update_product`
719
1335
  # @return [::Gapic::Config::Method]
720
1336
  #
@@ -729,6 +1345,21 @@ module Google
729
1345
  # @return [::Gapic::Config::Method]
730
1346
  #
731
1347
  attr_reader :import_products
1348
+ ##
1349
+ # RPC-specific configuration for `set_inventory`
1350
+ # @return [::Gapic::Config::Method]
1351
+ #
1352
+ attr_reader :set_inventory
1353
+ ##
1354
+ # RPC-specific configuration for `add_fulfillment_places`
1355
+ # @return [::Gapic::Config::Method]
1356
+ #
1357
+ attr_reader :add_fulfillment_places
1358
+ ##
1359
+ # RPC-specific configuration for `remove_fulfillment_places`
1360
+ # @return [::Gapic::Config::Method]
1361
+ #
1362
+ attr_reader :remove_fulfillment_places
732
1363
 
733
1364
  # @private
734
1365
  def initialize parent_rpcs = nil
@@ -736,12 +1367,20 @@ module Google
736
1367
  @create_product = ::Gapic::Config::Method.new create_product_config
737
1368
  get_product_config = parent_rpcs.get_product if parent_rpcs.respond_to? :get_product
738
1369
  @get_product = ::Gapic::Config::Method.new get_product_config
1370
+ list_products_config = parent_rpcs.list_products if parent_rpcs.respond_to? :list_products
1371
+ @list_products = ::Gapic::Config::Method.new list_products_config
739
1372
  update_product_config = parent_rpcs.update_product if parent_rpcs.respond_to? :update_product
740
1373
  @update_product = ::Gapic::Config::Method.new update_product_config
741
1374
  delete_product_config = parent_rpcs.delete_product if parent_rpcs.respond_to? :delete_product
742
1375
  @delete_product = ::Gapic::Config::Method.new delete_product_config
743
1376
  import_products_config = parent_rpcs.import_products if parent_rpcs.respond_to? :import_products
744
1377
  @import_products = ::Gapic::Config::Method.new import_products_config
1378
+ set_inventory_config = parent_rpcs.set_inventory if parent_rpcs.respond_to? :set_inventory
1379
+ @set_inventory = ::Gapic::Config::Method.new set_inventory_config
1380
+ add_fulfillment_places_config = parent_rpcs.add_fulfillment_places if parent_rpcs.respond_to? :add_fulfillment_places
1381
+ @add_fulfillment_places = ::Gapic::Config::Method.new add_fulfillment_places_config
1382
+ remove_fulfillment_places_config = parent_rpcs.remove_fulfillment_places if parent_rpcs.respond_to? :remove_fulfillment_places
1383
+ @remove_fulfillment_places = ::Gapic::Config::Method.new remove_fulfillment_places_config
745
1384
 
746
1385
  yield self if block_given?
747
1386
  end