google-cloud-retail-v2 0.6.4 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/google/cloud/retail/v2/catalog_pb.rb +0 -3
  4. data/lib/google/cloud/retail/v2/catalog_service/client.rb +9 -9
  5. data/lib/google/cloud/retail/v2/catalog_service_pb.rb +1 -0
  6. data/lib/google/cloud/retail/v2/catalog_service_services_pb.rb +0 -8
  7. data/lib/google/cloud/retail/v2/common_pb.rb +6 -4
  8. data/lib/google/cloud/retail/v2/completion_service/client.rb +17 -18
  9. data/lib/google/cloud/retail/v2/completion_service.rb +1 -2
  10. data/lib/google/cloud/retail/v2/completion_service_services_pb.rb +7 -7
  11. data/lib/google/cloud/retail/v2/import_config_pb.rb +0 -1
  12. data/lib/google/cloud/retail/v2/prediction_service/client.rb +6 -3
  13. data/lib/google/cloud/retail/v2/product_pb.rb +1 -1
  14. data/lib/google/cloud/retail/v2/product_service/client.rb +319 -18
  15. data/lib/google/cloud/retail/v2/product_service_pb.rb +27 -1
  16. data/lib/google/cloud/retail/v2/product_service_services_pb.rb +45 -7
  17. data/lib/google/cloud/retail/v2/promotion_pb.rb +22 -0
  18. data/lib/google/cloud/retail/v2/purge_config_pb.rb +1 -1
  19. data/lib/google/cloud/retail/v2/search_service/client.rb +25 -15
  20. data/lib/google/cloud/retail/v2/search_service.rb +1 -2
  21. data/lib/google/cloud/retail/v2/search_service_pb.rb +14 -2
  22. data/lib/google/cloud/retail/v2/search_service_services_pb.rb +2 -4
  23. data/lib/google/cloud/retail/v2/user_event_pb.rb +0 -1
  24. data/lib/google/cloud/retail/v2/user_event_service/client.rb +4 -3
  25. data/lib/google/cloud/retail/v2/user_event_service_pb.rb +1 -0
  26. data/lib/google/cloud/retail/v2/user_event_service_services_pb.rb +4 -3
  27. data/lib/google/cloud/retail/v2/version.rb +1 -1
  28. data/lib/google/cloud/retail/v2.rb +2 -0
  29. data/proto_docs/google/cloud/retail/v2/catalog_service.rb +9 -0
  30. data/proto_docs/google/cloud/retail/v2/common.rb +88 -25
  31. data/proto_docs/google/cloud/retail/v2/completion_service.rb +18 -15
  32. data/proto_docs/google/cloud/retail/v2/import_config.rb +29 -21
  33. data/proto_docs/google/cloud/retail/v2/prediction_service.rb +6 -3
  34. data/proto_docs/google/cloud/retail/v2/product.rb +48 -39
  35. data/proto_docs/google/cloud/retail/v2/product_service.rb +134 -2
  36. data/proto_docs/google/cloud/retail/v2/promotion.rb +43 -0
  37. data/proto_docs/google/cloud/retail/v2/search_service.rb +64 -10
  38. data/proto_docs/google/cloud/retail/v2/user_event.rb +25 -12
  39. metadata +5 -3
@@ -771,15 +771,7 @@ module Google
771
771
  # If no updateMask is specified, requires products.create permission.
772
772
  # If updateMask is specified, requires products.update permission.
773
773
  # @param request_id [::String]
774
- # Unique identifier provided by client, within the ancestor
775
- # dataset scope. Ensures idempotency and used for request deduplication.
776
- # Server-generated if unspecified. Up to 128 characters long and must match
777
- # the pattern: `[a-zA-Z0-9_]+`. This is returned as [Operation.name][] in
778
- # {::Google::Cloud::Retail::V2::ImportMetadata ImportMetadata}.
779
- #
780
- # Only supported when
781
- # {::Google::Cloud::Retail::V2::ImportProductsRequest#reconciliation_mode ImportProductsRequest.reconciliation_mode}
782
- # is set to `FULL`.
774
+ # Deprecated. This field has no effect.
783
775
  # @param input_config [::Google::Cloud::Retail::V2::ProductInputConfig, ::Hash]
784
776
  # Required. The desired input location of the data.
785
777
  # @param errors_config [::Google::Cloud::Retail::V2::ImportErrorsConfig, ::Hash]
@@ -903,7 +895,8 @@ module Google
903
895
  # {::Google::Cloud::Retail::V2::CreateProductRequest#product CreateProductRequest.product},
904
896
  # then any pre-existing inventory information for this product will be used.
905
897
  #
906
- # If no inventory fields are set in [UpdateProductRequest.set_mask][],
898
+ # If no inventory fields are set in
899
+ # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask},
907
900
  # then any existing inventory information will be preserved.
908
901
  #
909
902
  # Pre-existing inventory information can only be updated with
@@ -913,8 +906,7 @@ module Google
913
906
  # {::Google::Cloud::Retail::V2::ProductService::Client#remove_fulfillment_places RemoveFulfillmentPlaces}.
914
907
  #
915
908
  # This feature is only available for users who have Retail Search enabled.
916
- # Please submit a form [here](https://cloud.google.com/contact) to contact
917
- # cloud sales if you are interested in using Retail Search.
909
+ # Please enable Retail Search on Cloud Console before using this feature.
918
910
  #
919
911
  # @overload set_inventory(request, options = nil)
920
912
  # Pass arguments to `set_inventory` via a request object, either of type
@@ -959,6 +951,24 @@ module Google
959
951
  # provided or default value for
960
952
  # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_time SetInventoryRequest.set_time}.
961
953
  #
954
+ # The caller can replace place IDs for a subset of fulfillment types in the
955
+ # following ways:
956
+ #
957
+ # * Adds "fulfillment_info" in
958
+ # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask}
959
+ # * Specifies only the desired fulfillment types and corresponding place IDs
960
+ # to update in [SetInventoryRequest.inventory.fulfillment_info][]
961
+ #
962
+ # The caller can clear all place IDs from a subset of fulfillment types in
963
+ # the following ways:
964
+ #
965
+ # * Adds "fulfillment_info" in
966
+ # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask}
967
+ # * Specifies only the desired fulfillment types to clear in
968
+ # [SetInventoryRequest.inventory.fulfillment_info][]
969
+ # * Checks that only the desired fulfillment info types have empty
970
+ # [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
971
+ #
962
972
  # The last update time is recorded for the following inventory fields:
963
973
  # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info}
964
974
  # * {::Google::Cloud::Retail::V2::Product#availability Product.availability}
@@ -969,8 +979,9 @@ module Google
969
979
  # needed, [UpdateProduct][] should be invoked instead.
970
980
  # @param set_mask [::Google::Protobuf::FieldMask, ::Hash]
971
981
  # Indicates which inventory fields in the provided
972
- # {::Google::Cloud::Retail::V2::Product Product} to update. If not set or set with
973
- # empty paths, all inventory fields will be updated.
982
+ # {::Google::Cloud::Retail::V2::Product Product} to update.
983
+ #
984
+ # At least one field must be provided.
974
985
  #
975
986
  # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
976
987
  # is returned and the entire update will be ignored.
@@ -1072,8 +1083,7 @@ module Google
1072
1083
  # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ListProducts}.
1073
1084
  #
1074
1085
  # This feature is only available for users who have Retail Search enabled.
1075
- # Please submit a form [here](https://cloud.google.com/contact) to contact
1076
- # cloud sales if you are interested in using Retail Search.
1086
+ # Please enable Retail Search on Cloud Console before using this feature.
1077
1087
  #
1078
1088
  # @overload add_fulfillment_places(request, options = nil)
1079
1089
  # Pass arguments to `add_fulfillment_places` via a request object, either of type
@@ -1232,8 +1242,7 @@ module Google
1232
1242
  # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ListProducts}.
1233
1243
  #
1234
1244
  # This feature is only available for users who have Retail Search enabled.
1235
- # Please submit a form [here](https://cloud.google.com/contact) to contact
1236
- # cloud sales if you are interested in using Retail Search.
1245
+ # Please enable Retail Search on Cloud Console before using this feature.
1237
1246
  #
1238
1247
  # @overload remove_fulfillment_places(request, options = nil)
1239
1248
  # Pass arguments to `remove_fulfillment_places` via a request object, either of type
@@ -1373,6 +1382,284 @@ module Google
1373
1382
  raise ::Google::Cloud::Error.from_error(e)
1374
1383
  end
1375
1384
 
1385
+ ##
1386
+ # Updates local inventory information for a
1387
+ # {::Google::Cloud::Retail::V2::Product Product} at a list of places, while
1388
+ # respecting the last update timestamps of each inventory field.
1389
+ #
1390
+ # This process is asynchronous and does not require the
1391
+ # {::Google::Cloud::Retail::V2::Product Product} to exist before updating
1392
+ # inventory information. If the request is valid, the update will be enqueued
1393
+ # and processed downstream. As a consequence, when a response is returned,
1394
+ # updates are not immediately manifested in the
1395
+ # {::Google::Cloud::Retail::V2::Product Product} queried by
1396
+ # {::Google::Cloud::Retail::V2::ProductService::Client#get_product GetProduct} or
1397
+ # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ListProducts}.
1398
+ #
1399
+ # Local inventory information can only be modified using this method.
1400
+ # {::Google::Cloud::Retail::V2::ProductService::Client#create_product CreateProduct} and
1401
+ # {::Google::Cloud::Retail::V2::ProductService::Client#update_product UpdateProduct} has no
1402
+ # effect on local inventories.
1403
+ #
1404
+ # This feature is only available for users who have Retail Search enabled.
1405
+ # Please enable Retail Search on Cloud Console before using this feature.
1406
+ #
1407
+ # @overload add_local_inventories(request, options = nil)
1408
+ # Pass arguments to `add_local_inventories` via a request object, either of type
1409
+ # {::Google::Cloud::Retail::V2::AddLocalInventoriesRequest} or an equivalent Hash.
1410
+ #
1411
+ # @param request [::Google::Cloud::Retail::V2::AddLocalInventoriesRequest, ::Hash]
1412
+ # A request object representing the call parameters. Required. To specify no
1413
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1414
+ # @param options [::Gapic::CallOptions, ::Hash]
1415
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1416
+ #
1417
+ # @overload add_local_inventories(product: nil, local_inventories: nil, add_mask: nil, add_time: nil, allow_missing: nil)
1418
+ # Pass arguments to `add_local_inventories` via keyword arguments. Note that at
1419
+ # least one keyword argument is required. To specify no parameters, or to keep all
1420
+ # the default parameter values, pass an empty Hash as a request object (see above).
1421
+ #
1422
+ # @param product [::String]
1423
+ # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product},
1424
+ # such as
1425
+ # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
1426
+ #
1427
+ # If the caller does not have permission to access the
1428
+ # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it
1429
+ # exists, a PERMISSION_DENIED error is returned.
1430
+ # @param local_inventories [::Array<::Google::Cloud::Retail::V2::LocalInventory, ::Hash>]
1431
+ # Required. A list of inventory information at difference places. Each place
1432
+ # is identified by its place ID. At most 3000 inventories are allowed per
1433
+ # request.
1434
+ # @param add_mask [::Google::Protobuf::FieldMask, ::Hash]
1435
+ # Indicates which inventory fields in the provided list of
1436
+ # {::Google::Cloud::Retail::V2::LocalInventory LocalInventory} to update. The
1437
+ # field is updated to the provided value.
1438
+ #
1439
+ # If a field is set while the place does not have a previous local inventory,
1440
+ # the local inventory at that store is created.
1441
+ #
1442
+ # If a field is set while the value of that field is not provided, the
1443
+ # original field value, if it exists, is deleted.
1444
+ #
1445
+ # If the mask is not set or set with empty paths, all inventory fields will
1446
+ # be updated.
1447
+ #
1448
+ # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
1449
+ # is returned and the entire update will be ignored.
1450
+ # @param add_time [::Google::Protobuf::Timestamp, ::Hash]
1451
+ # The time when the inventory updates are issued. Used to prevent
1452
+ # out-of-order updates on local inventory fields. If not provided, the
1453
+ # internal system time will be used.
1454
+ # @param allow_missing [::Boolean]
1455
+ # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not
1456
+ # found, the local inventory will still be processed and retained for at most
1457
+ # 1 day and processed once the {::Google::Cloud::Retail::V2::Product Product} is
1458
+ # created. If set to false, a NOT_FOUND error is returned if the
1459
+ # {::Google::Cloud::Retail::V2::Product Product} is not found.
1460
+ #
1461
+ # @yield [response, operation] Access the result along with the RPC operation
1462
+ # @yieldparam response [::Gapic::Operation]
1463
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1464
+ #
1465
+ # @return [::Gapic::Operation]
1466
+ #
1467
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1468
+ #
1469
+ # @example Basic example
1470
+ # require "google/cloud/retail/v2"
1471
+ #
1472
+ # # Create a client object. The client can be reused for multiple calls.
1473
+ # client = Google::Cloud::Retail::V2::ProductService::Client.new
1474
+ #
1475
+ # # Create a request. To set request fields, pass in keyword arguments.
1476
+ # request = Google::Cloud::Retail::V2::AddLocalInventoriesRequest.new
1477
+ #
1478
+ # # Call the add_local_inventories method.
1479
+ # result = client.add_local_inventories request
1480
+ #
1481
+ # # The returned object is of type Gapic::Operation. You can use this
1482
+ # # object to check the status of an operation, cancel it, or wait
1483
+ # # for results. Here is how to block until completion:
1484
+ # result.wait_until_done! timeout: 60
1485
+ # if result.response?
1486
+ # p result.response
1487
+ # else
1488
+ # puts "Error!"
1489
+ # end
1490
+ #
1491
+ def add_local_inventories request, options = nil
1492
+ raise ::ArgumentError, "request must be provided" if request.nil?
1493
+
1494
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::AddLocalInventoriesRequest
1495
+
1496
+ # Converts hash and nil to an options object
1497
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1498
+
1499
+ # Customize the options with defaults
1500
+ metadata = @config.rpcs.add_local_inventories.metadata.to_h
1501
+
1502
+ # Set x-goog-api-client and x-goog-user-project headers
1503
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1504
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1505
+ gapic_version: ::Google::Cloud::Retail::V2::VERSION
1506
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1507
+
1508
+ header_params = {}
1509
+ if request.product
1510
+ header_params["product"] = request.product
1511
+ end
1512
+
1513
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1514
+ metadata[:"x-goog-request-params"] ||= request_params_header
1515
+
1516
+ options.apply_defaults timeout: @config.rpcs.add_local_inventories.timeout,
1517
+ metadata: metadata,
1518
+ retry_policy: @config.rpcs.add_local_inventories.retry_policy
1519
+
1520
+ options.apply_defaults timeout: @config.timeout,
1521
+ metadata: @config.metadata,
1522
+ retry_policy: @config.retry_policy
1523
+
1524
+ @product_service_stub.call_rpc :add_local_inventories, request, options: options do |response, operation|
1525
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1526
+ yield response, operation if block_given?
1527
+ return response
1528
+ end
1529
+ rescue ::GRPC::BadStatus => e
1530
+ raise ::Google::Cloud::Error.from_error(e)
1531
+ end
1532
+
1533
+ ##
1534
+ # Remove local inventory information for a
1535
+ # {::Google::Cloud::Retail::V2::Product Product} at a list of places at a removal
1536
+ # timestamp.
1537
+ #
1538
+ # This process is asynchronous. If the request is valid, the removal will be
1539
+ # enqueued and processed downstream. As a consequence, when a response is
1540
+ # returned, removals are not immediately manifested in the
1541
+ # {::Google::Cloud::Retail::V2::Product Product} queried by
1542
+ # {::Google::Cloud::Retail::V2::ProductService::Client#get_product GetProduct} or
1543
+ # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ListProducts}.
1544
+ #
1545
+ # Local inventory information can only be removed using this method.
1546
+ # {::Google::Cloud::Retail::V2::ProductService::Client#create_product CreateProduct} and
1547
+ # {::Google::Cloud::Retail::V2::ProductService::Client#update_product UpdateProduct} has no
1548
+ # effect on local inventories.
1549
+ #
1550
+ # This feature is only available for users who have Retail Search enabled.
1551
+ # Please enable Retail Search on Cloud Console before using this feature.
1552
+ #
1553
+ # @overload remove_local_inventories(request, options = nil)
1554
+ # Pass arguments to `remove_local_inventories` via a request object, either of type
1555
+ # {::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest} or an equivalent Hash.
1556
+ #
1557
+ # @param request [::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest, ::Hash]
1558
+ # A request object representing the call parameters. Required. To specify no
1559
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1560
+ # @param options [::Gapic::CallOptions, ::Hash]
1561
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1562
+ #
1563
+ # @overload remove_local_inventories(product: nil, place_ids: nil, remove_time: nil, allow_missing: nil)
1564
+ # Pass arguments to `remove_local_inventories` via keyword arguments. Note that at
1565
+ # least one keyword argument is required. To specify no parameters, or to keep all
1566
+ # the default parameter values, pass an empty Hash as a request object (see above).
1567
+ #
1568
+ # @param product [::String]
1569
+ # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product},
1570
+ # such as
1571
+ # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
1572
+ #
1573
+ # If the caller does not have permission to access the
1574
+ # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it
1575
+ # exists, a PERMISSION_DENIED error is returned.
1576
+ # @param place_ids [::Array<::String>]
1577
+ # Required. A list of place IDs to have their inventory deleted.
1578
+ # At most 3000 place IDs are allowed per request.
1579
+ # @param remove_time [::Google::Protobuf::Timestamp, ::Hash]
1580
+ # The time when the inventory deletions are issued. Used to prevent
1581
+ # out-of-order updates and deletions on local inventory fields. If not
1582
+ # provided, the internal system time will be used.
1583
+ # @param allow_missing [::Boolean]
1584
+ # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not
1585
+ # found, the local inventory removal request will still be processed and
1586
+ # retained for at most 1 day and processed once the
1587
+ # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, a
1588
+ # NOT_FOUND error is returned if the
1589
+ # {::Google::Cloud::Retail::V2::Product Product} is not found.
1590
+ #
1591
+ # @yield [response, operation] Access the result along with the RPC operation
1592
+ # @yieldparam response [::Gapic::Operation]
1593
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1594
+ #
1595
+ # @return [::Gapic::Operation]
1596
+ #
1597
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1598
+ #
1599
+ # @example Basic example
1600
+ # require "google/cloud/retail/v2"
1601
+ #
1602
+ # # Create a client object. The client can be reused for multiple calls.
1603
+ # client = Google::Cloud::Retail::V2::ProductService::Client.new
1604
+ #
1605
+ # # Create a request. To set request fields, pass in keyword arguments.
1606
+ # request = Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest.new
1607
+ #
1608
+ # # Call the remove_local_inventories method.
1609
+ # result = client.remove_local_inventories request
1610
+ #
1611
+ # # The returned object is of type Gapic::Operation. You can use this
1612
+ # # object to check the status of an operation, cancel it, or wait
1613
+ # # for results. Here is how to block until completion:
1614
+ # result.wait_until_done! timeout: 60
1615
+ # if result.response?
1616
+ # p result.response
1617
+ # else
1618
+ # puts "Error!"
1619
+ # end
1620
+ #
1621
+ def remove_local_inventories request, options = nil
1622
+ raise ::ArgumentError, "request must be provided" if request.nil?
1623
+
1624
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest
1625
+
1626
+ # Converts hash and nil to an options object
1627
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1628
+
1629
+ # Customize the options with defaults
1630
+ metadata = @config.rpcs.remove_local_inventories.metadata.to_h
1631
+
1632
+ # Set x-goog-api-client and x-goog-user-project headers
1633
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1634
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1635
+ gapic_version: ::Google::Cloud::Retail::V2::VERSION
1636
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1637
+
1638
+ header_params = {}
1639
+ if request.product
1640
+ header_params["product"] = request.product
1641
+ end
1642
+
1643
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1644
+ metadata[:"x-goog-request-params"] ||= request_params_header
1645
+
1646
+ options.apply_defaults timeout: @config.rpcs.remove_local_inventories.timeout,
1647
+ metadata: metadata,
1648
+ retry_policy: @config.rpcs.remove_local_inventories.retry_policy
1649
+
1650
+ options.apply_defaults timeout: @config.timeout,
1651
+ metadata: @config.metadata,
1652
+ retry_policy: @config.retry_policy
1653
+
1654
+ @product_service_stub.call_rpc :remove_local_inventories, request, options: options do |response, operation|
1655
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1656
+ yield response, operation if block_given?
1657
+ return response
1658
+ end
1659
+ rescue ::GRPC::BadStatus => e
1660
+ raise ::Google::Cloud::Error.from_error(e)
1661
+ end
1662
+
1376
1663
  ##
1377
1664
  # Configuration class for the ProductService API.
1378
1665
  #
@@ -1553,6 +1840,16 @@ module Google
1553
1840
  # @return [::Gapic::Config::Method]
1554
1841
  #
1555
1842
  attr_reader :remove_fulfillment_places
1843
+ ##
1844
+ # RPC-specific configuration for `add_local_inventories`
1845
+ # @return [::Gapic::Config::Method]
1846
+ #
1847
+ attr_reader :add_local_inventories
1848
+ ##
1849
+ # RPC-specific configuration for `remove_local_inventories`
1850
+ # @return [::Gapic::Config::Method]
1851
+ #
1852
+ attr_reader :remove_local_inventories
1556
1853
 
1557
1854
  # @private
1558
1855
  def initialize parent_rpcs = nil
@@ -1574,6 +1871,10 @@ module Google
1574
1871
  @add_fulfillment_places = ::Gapic::Config::Method.new add_fulfillment_places_config
1575
1872
  remove_fulfillment_places_config = parent_rpcs.remove_fulfillment_places if parent_rpcs.respond_to? :remove_fulfillment_places
1576
1873
  @remove_fulfillment_places = ::Gapic::Config::Method.new remove_fulfillment_places_config
1874
+ add_local_inventories_config = parent_rpcs.add_local_inventories if parent_rpcs.respond_to? :add_local_inventories
1875
+ @add_local_inventories = ::Gapic::Config::Method.new add_local_inventories_config
1876
+ remove_local_inventories_config = parent_rpcs.remove_local_inventories if parent_rpcs.respond_to? :remove_local_inventories
1877
+ @remove_local_inventories = ::Gapic::Config::Method.new remove_local_inventories_config
1577
1878
 
1578
1879
  yield self if block_given?
1579
1880
  end
@@ -8,7 +8,6 @@ require 'google/api/resource_pb'
8
8
  require 'google/cloud/retail/v2/common_pb'
9
9
  require 'google/cloud/retail/v2/import_config_pb'
10
10
  require 'google/cloud/retail/v2/product_pb'
11
- require 'google/cloud/retail/v2/purge_config_pb'
12
11
  require 'google/longrunning/operations_pb'
13
12
  require 'google/protobuf/empty_pb'
14
13
  require 'google/protobuf/field_mask_pb'
@@ -65,6 +64,27 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
65
64
  end
66
65
  add_message "google.cloud.retail.v2.AddFulfillmentPlacesResponse" do
67
66
  end
67
+ add_message "google.cloud.retail.v2.AddLocalInventoriesRequest" do
68
+ optional :product, :string, 1
69
+ repeated :local_inventories, :message, 2, "google.cloud.retail.v2.LocalInventory"
70
+ optional :add_mask, :message, 4, "google.protobuf.FieldMask"
71
+ optional :add_time, :message, 5, "google.protobuf.Timestamp"
72
+ optional :allow_missing, :bool, 6
73
+ end
74
+ add_message "google.cloud.retail.v2.AddLocalInventoriesMetadata" do
75
+ end
76
+ add_message "google.cloud.retail.v2.AddLocalInventoriesResponse" do
77
+ end
78
+ add_message "google.cloud.retail.v2.RemoveLocalInventoriesRequest" do
79
+ optional :product, :string, 1
80
+ repeated :place_ids, :string, 2
81
+ optional :remove_time, :message, 5, "google.protobuf.Timestamp"
82
+ optional :allow_missing, :bool, 3
83
+ end
84
+ add_message "google.cloud.retail.v2.RemoveLocalInventoriesMetadata" do
85
+ end
86
+ add_message "google.cloud.retail.v2.RemoveLocalInventoriesResponse" do
87
+ end
68
88
  add_message "google.cloud.retail.v2.RemoveFulfillmentPlacesRequest" do
69
89
  optional :product, :string, 1
70
90
  optional :type, :string, 2
@@ -95,6 +115,12 @@ module Google
95
115
  AddFulfillmentPlacesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AddFulfillmentPlacesRequest").msgclass
96
116
  AddFulfillmentPlacesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AddFulfillmentPlacesMetadata").msgclass
97
117
  AddFulfillmentPlacesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AddFulfillmentPlacesResponse").msgclass
118
+ AddLocalInventoriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AddLocalInventoriesRequest").msgclass
119
+ AddLocalInventoriesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AddLocalInventoriesMetadata").msgclass
120
+ AddLocalInventoriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AddLocalInventoriesResponse").msgclass
121
+ RemoveLocalInventoriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RemoveLocalInventoriesRequest").msgclass
122
+ RemoveLocalInventoriesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RemoveLocalInventoriesMetadata").msgclass
123
+ RemoveLocalInventoriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RemoveLocalInventoriesResponse").msgclass
98
124
  RemoveFulfillmentPlacesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RemoveFulfillmentPlacesRequest").msgclass
99
125
  RemoveFulfillmentPlacesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata").msgclass
100
126
  RemoveFulfillmentPlacesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RemoveFulfillmentPlacesResponse").msgclass
@@ -80,7 +80,8 @@ module Google
80
80
  # [CreateProductRequest.product][google.cloud.retail.v2.CreateProductRequest.product],
81
81
  # then any pre-existing inventory information for this product will be used.
82
82
  #
83
- # If no inventory fields are set in [UpdateProductRequest.set_mask][],
83
+ # If no inventory fields are set in
84
+ # [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask],
84
85
  # then any existing inventory information will be preserved.
85
86
  #
86
87
  # Pre-existing inventory information can only be updated with
@@ -90,8 +91,7 @@ module Google
90
91
  # [RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces].
91
92
  #
92
93
  # This feature is only available for users who have Retail Search enabled.
93
- # Please submit a form [here](https://cloud.google.com/contact) to contact
94
- # cloud sales if you are interested in using Retail Search.
94
+ # Please enable Retail Search on Cloud Console before using this feature.
95
95
  rpc :SetInventory, ::Google::Cloud::Retail::V2::SetInventoryRequest, ::Google::Longrunning::Operation
96
96
  # Incrementally adds place IDs to
97
97
  # [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids].
@@ -106,8 +106,7 @@ module Google
106
106
  # [ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
107
107
  #
108
108
  # This feature is only available for users who have Retail Search enabled.
109
- # Please submit a form [here](https://cloud.google.com/contact) to contact
110
- # cloud sales if you are interested in using Retail Search.
109
+ # Please enable Retail Search on Cloud Console before using this feature.
111
110
  rpc :AddFulfillmentPlaces, ::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest, ::Google::Longrunning::Operation
112
111
  # Incrementally removes place IDs from a
113
112
  # [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids].
@@ -122,9 +121,48 @@ module Google
122
121
  # [ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
123
122
  #
124
123
  # This feature is only available for users who have Retail Search enabled.
125
- # Please submit a form [here](https://cloud.google.com/contact) to contact
126
- # cloud sales if you are interested in using Retail Search.
124
+ # Please enable Retail Search on Cloud Console before using this feature.
127
125
  rpc :RemoveFulfillmentPlaces, ::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest, ::Google::Longrunning::Operation
126
+ # Updates local inventory information for a
127
+ # [Product][google.cloud.retail.v2.Product] at a list of places, while
128
+ # respecting the last update timestamps of each inventory field.
129
+ #
130
+ # This process is asynchronous and does not require the
131
+ # [Product][google.cloud.retail.v2.Product] to exist before updating
132
+ # inventory information. If the request is valid, the update will be enqueued
133
+ # and processed downstream. As a consequence, when a response is returned,
134
+ # updates are not immediately manifested in the
135
+ # [Product][google.cloud.retail.v2.Product] queried by
136
+ # [GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or
137
+ # [ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
138
+ #
139
+ # Local inventory information can only be modified using this method.
140
+ # [CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and
141
+ # [UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] has no
142
+ # effect on local inventories.
143
+ #
144
+ # This feature is only available for users who have Retail Search enabled.
145
+ # Please enable Retail Search on Cloud Console before using this feature.
146
+ rpc :AddLocalInventories, ::Google::Cloud::Retail::V2::AddLocalInventoriesRequest, ::Google::Longrunning::Operation
147
+ # Remove local inventory information for a
148
+ # [Product][google.cloud.retail.v2.Product] at a list of places at a removal
149
+ # timestamp.
150
+ #
151
+ # This process is asynchronous. If the request is valid, the removal will be
152
+ # enqueued and processed downstream. As a consequence, when a response is
153
+ # returned, removals are not immediately manifested in the
154
+ # [Product][google.cloud.retail.v2.Product] queried by
155
+ # [GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or
156
+ # [ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
157
+ #
158
+ # Local inventory information can only be removed using this method.
159
+ # [CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and
160
+ # [UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] has no
161
+ # effect on local inventories.
162
+ #
163
+ # This feature is only available for users who have Retail Search enabled.
164
+ # Please enable Retail Search on Cloud Console before using this feature.
165
+ rpc :RemoveLocalInventories, ::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest, ::Google::Longrunning::Operation
128
166
  end
129
167
 
130
168
  Stub = Service.rpc_stub_class
@@ -0,0 +1,22 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/retail/v2/promotion.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_file("google/cloud/retail/v2/promotion.proto", :syntax => :proto3) do
8
+ add_message "google.cloud.retail.v2.Promotion" do
9
+ optional :promotion_id, :string, 1
10
+ end
11
+ end
12
+ end
13
+
14
+ module Google
15
+ module Cloud
16
+ module Retail
17
+ module V2
18
+ Promotion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Promotion").msgclass
19
+ end
20
+ end
21
+ end
22
+ end
@@ -1,8 +1,8 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/retail/v2/purge_config.proto
3
3
 
4
- require 'google/api/annotations_pb'
5
4
  require 'google/api/field_behavior_pb'
5
+ require 'google/api/resource_pb'
6
6
  require 'google/protobuf'
7
7
 
8
8
  Google::Protobuf::DescriptorPool.generated_pool.build do