google-apis-retail_v2 0.12.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -51,6 +51,110 @@ module Google
51
51
  @batch_path = 'batch'
52
52
  end
53
53
 
54
+ # Completes the specified prefix with keyword suggestions. This feature is only
55
+ # available for users who have Retail Search enabled. Contact Retail Support (
56
+ # retail-search-support@google.com) if you are interested in using Retail Search.
57
+ # @param [String] catalog
58
+ # Required. Catalog for which the completion is performed. Full resource name of
59
+ # catalog, such as `projects/*/locations/global/catalogs/default_catalog`.
60
+ # @param [String] dataset
61
+ # Determines which dataset to use for fetching completion. "user-data" will use
62
+ # the imported dataset through ImportCompletionData. "cloud-retail" will use the
63
+ # dataset generated by cloud retail based on user events. If leave empty, it
64
+ # will use the "user-data". Current supported values: * user-data * cloud-retail
65
+ # This option is not automatically enabled. Before using cloud-retail, contact
66
+ # retail-search-support@google.com first.
67
+ # @param [String] device_type
68
+ # The device type context for completion suggestions. It is useful to apply
69
+ # different suggestions on different device types, e.g. DESKTOP, MOBILE. If it
70
+ # is empty, the suggestions are across all device types. Supported formats: *
71
+ # UNKNOWN_DEVICE_TYPE * DESKTOP * MOBILE * A customized string starts with
72
+ # OTHER_, e.g. OTHER_IPHONE.
73
+ # @param [Array<String>, String] language_codes
74
+ # The list of languages of the query. This is the BCP-47 language code, such as "
75
+ # en-US" or "sr-Latn". For more information, see [Tags for Identifying Languages]
76
+ # (https://tools.ietf.org/html/bcp47). The maximum number of allowed characters
77
+ # is 255. Only "en-US" is currently supported.
78
+ # @param [Fixnum] max_suggestions
79
+ # Completion max suggestions. The maximum allowed max suggestions is 20. The
80
+ # default value is 20.
81
+ # @param [String] query
82
+ # Required. The query used to generate suggestions. The maximum number of
83
+ # allowed characters is 255.
84
+ # @param [String] visitor_id
85
+ # A unique identifier for tracking visitors. For example, this could be
86
+ # implemented with an HTTP cookie, which should be able to uniquely identify a
87
+ # visitor on a single device. This unique identifier should not change if the
88
+ # visitor logs in or out of the website. The field must be a UTF-8 encoded
89
+ # string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT
90
+ # error is returned.
91
+ # @param [String] fields
92
+ # Selector specifying which fields to include in a partial response.
93
+ # @param [String] quota_user
94
+ # Available to use for quota purposes for server-side applications. Can be any
95
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
96
+ # @param [Google::Apis::RequestOptions] options
97
+ # Request-specific options
98
+ #
99
+ # @yield [result, err] Result & error if block supplied
100
+ # @yieldparam result [Google::Apis::RetailV2::GoogleCloudRetailV2CompleteQueryResponse] parsed result object
101
+ # @yieldparam err [StandardError] error object if request failed
102
+ #
103
+ # @return [Google::Apis::RetailV2::GoogleCloudRetailV2CompleteQueryResponse]
104
+ #
105
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
106
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
107
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
108
+ def complete_project_location_catalog_query(catalog, dataset: nil, device_type: nil, language_codes: nil, max_suggestions: nil, query: nil, visitor_id: nil, fields: nil, quota_user: nil, options: nil, &block)
109
+ command = make_simple_command(:get, 'v2/{+catalog}:completeQuery', options)
110
+ command.response_representation = Google::Apis::RetailV2::GoogleCloudRetailV2CompleteQueryResponse::Representation
111
+ command.response_class = Google::Apis::RetailV2::GoogleCloudRetailV2CompleteQueryResponse
112
+ command.params['catalog'] = catalog unless catalog.nil?
113
+ command.query['dataset'] = dataset unless dataset.nil?
114
+ command.query['deviceType'] = device_type unless device_type.nil?
115
+ command.query['languageCodes'] = language_codes unless language_codes.nil?
116
+ command.query['maxSuggestions'] = max_suggestions unless max_suggestions.nil?
117
+ command.query['query'] = query unless query.nil?
118
+ command.query['visitorId'] = visitor_id unless visitor_id.nil?
119
+ command.query['fields'] = fields unless fields.nil?
120
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
121
+ execute_or_queue_command(command, &block)
122
+ end
123
+
124
+ # Get which branch is currently default branch set by CatalogService.
125
+ # SetDefaultBranch method under a specified parent catalog. This feature is only
126
+ # available for users who have Retail Search enabled. Contact Retail Support (
127
+ # retail-search-support@google.com) if you are interested in using Retail Search.
128
+ # @param [String] catalog
129
+ # The parent catalog resource name, such as `projects/*/locations/global/
130
+ # catalogs/default_catalog`.
131
+ # @param [String] fields
132
+ # Selector specifying which fields to include in a partial response.
133
+ # @param [String] quota_user
134
+ # Available to use for quota purposes for server-side applications. Can be any
135
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
136
+ # @param [Google::Apis::RequestOptions] options
137
+ # Request-specific options
138
+ #
139
+ # @yield [result, err] Result & error if block supplied
140
+ # @yieldparam result [Google::Apis::RetailV2::GoogleCloudRetailV2GetDefaultBranchResponse] parsed result object
141
+ # @yieldparam err [StandardError] error object if request failed
142
+ #
143
+ # @return [Google::Apis::RetailV2::GoogleCloudRetailV2GetDefaultBranchResponse]
144
+ #
145
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
146
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
147
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
148
+ def get_project_location_catalog_default_branch(catalog, fields: nil, quota_user: nil, options: nil, &block)
149
+ command = make_simple_command(:get, 'v2/{+catalog}:getDefaultBranch', options)
150
+ command.response_representation = Google::Apis::RetailV2::GoogleCloudRetailV2GetDefaultBranchResponse::Representation
151
+ command.response_class = Google::Apis::RetailV2::GoogleCloudRetailV2GetDefaultBranchResponse
152
+ command.params['catalog'] = catalog unless catalog.nil?
153
+ command.query['fields'] = fields unless fields.nil?
154
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
155
+ execute_or_queue_command(command, &block)
156
+ end
157
+
54
158
  # Lists all the Catalogs associated with the project.
55
159
  # @param [String] parent
56
160
  # Required. The account resource name with an associated location. If the caller
@@ -132,6 +236,59 @@ module Google
132
236
  execute_or_queue_command(command, &block)
133
237
  end
134
238
 
239
+ # Set a specified branch id as default branch. API methods such as SearchService.
240
+ # Search, ProductService.GetProduct, ProductService.ListProducts will treat
241
+ # requests using "default_branch" to the actual branch id set as default. For
242
+ # example, if `projects/*/locations/*/catalogs/*/branches/1` is set as default,
243
+ # setting SearchRequest.branch to `projects/*/locations/*/catalogs/*/branches/
244
+ # default_branch` is equivalent to setting SearchRequest.branch to `projects/*/
245
+ # locations/*/catalogs/*/branches/1`. Using multiple branches can be useful when
246
+ # developers would like to have a staging branch to test and verify for future
247
+ # usage. When it becomes ready, developers switch on the staging branch using
248
+ # this API while keeping using `projects/*/locations/*/catalogs/*/branches/
249
+ # default_branch` as SearchRequest.branch to route the traffic to this staging
250
+ # branch. CAUTION: If you have live predict/search traffic, switching the
251
+ # default branch could potentially cause outages if the ID space of the new
252
+ # branch is very different from the old one. More specifically: *
253
+ # PredictionService will only return product IDs from branch `newBranch`. *
254
+ # SearchService will only return product IDs from branch `newBranch` (if branch
255
+ # is not explicitly set). * UserEventService will only join events with products
256
+ # from branch `newBranch`. This feature is only available for users who have
257
+ # Retail Search enabled. Contact Retail Support (retail-search-support@google.
258
+ # com) if you are interested in using Retail Search.
259
+ # @param [String] catalog
260
+ # Full resource name of the catalog, such as `projects/*/locations/global/
261
+ # catalogs/default_catalog`.
262
+ # @param [Google::Apis::RetailV2::GoogleCloudRetailV2SetDefaultBranchRequest] google_cloud_retail_v2_set_default_branch_request_object
263
+ # @param [String] fields
264
+ # Selector specifying which fields to include in a partial response.
265
+ # @param [String] quota_user
266
+ # Available to use for quota purposes for server-side applications. Can be any
267
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
268
+ # @param [Google::Apis::RequestOptions] options
269
+ # Request-specific options
270
+ #
271
+ # @yield [result, err] Result & error if block supplied
272
+ # @yieldparam result [Google::Apis::RetailV2::GoogleProtobufEmpty] parsed result object
273
+ # @yieldparam err [StandardError] error object if request failed
274
+ #
275
+ # @return [Google::Apis::RetailV2::GoogleProtobufEmpty]
276
+ #
277
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
278
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
279
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
280
+ def set_project_location_catalog_default_branch(catalog, google_cloud_retail_v2_set_default_branch_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
281
+ command = make_simple_command(:post, 'v2/{+catalog}:setDefaultBranch', options)
282
+ command.request_representation = Google::Apis::RetailV2::GoogleCloudRetailV2SetDefaultBranchRequest::Representation
283
+ command.request_object = google_cloud_retail_v2_set_default_branch_request_object
284
+ command.response_representation = Google::Apis::RetailV2::GoogleProtobufEmpty::Representation
285
+ command.response_class = Google::Apis::RetailV2::GoogleProtobufEmpty
286
+ command.params['catalog'] = catalog unless catalog.nil?
287
+ command.query['fields'] = fields unless fields.nil?
288
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
289
+ execute_or_queue_command(command, &block)
290
+ end
291
+
135
292
  # Gets the latest state of a long-running operation. Clients can use this method
136
293
  # to poll the operation result at intervals as recommended by the API service.
137
294
  # @param [String] name
@@ -163,6 +320,49 @@ module Google
163
320
  execute_or_queue_command(command, &block)
164
321
  end
165
322
 
323
+ # Incrementally adds place IDs to Product.fulfillment_info.place_ids. This
324
+ # process is asynchronous and does not require the Product to exist before
325
+ # updating fulfillment information. If the request is valid, the update will be
326
+ # enqueued and processed downstream. As a consequence, when a response is
327
+ # returned, the added place IDs are not immediately manifested in the Product
328
+ # queried by GetProduct or ListProducts. This feature is only available for
329
+ # users who have Retail Search enabled. Contact Retail Support (retail-search-
330
+ # support@google.com) if you are interested in using Retail Search.
331
+ # @param [String] product
332
+ # Required. Full resource name of Product, such as `projects/*/locations/global/
333
+ # catalogs/default_catalog/branches/default_branch/products/some_product_id`. If
334
+ # the caller does not have permission to access the Product, regardless of
335
+ # whether or not it exists, a PERMISSION_DENIED error is returned.
336
+ # @param [Google::Apis::RetailV2::GoogleCloudRetailV2AddFulfillmentPlacesRequest] google_cloud_retail_v2_add_fulfillment_places_request_object
337
+ # @param [String] fields
338
+ # Selector specifying which fields to include in a partial response.
339
+ # @param [String] quota_user
340
+ # Available to use for quota purposes for server-side applications. Can be any
341
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
342
+ # @param [Google::Apis::RequestOptions] options
343
+ # Request-specific options
344
+ #
345
+ # @yield [result, err] Result & error if block supplied
346
+ # @yieldparam result [Google::Apis::RetailV2::GoogleLongrunningOperation] parsed result object
347
+ # @yieldparam err [StandardError] error object if request failed
348
+ #
349
+ # @return [Google::Apis::RetailV2::GoogleLongrunningOperation]
350
+ #
351
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
352
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
353
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
354
+ def add_project_location_catalog_branch_product_fulfillment_places(product, google_cloud_retail_v2_add_fulfillment_places_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
355
+ command = make_simple_command(:post, 'v2/{+product}:addFulfillmentPlaces', options)
356
+ command.request_representation = Google::Apis::RetailV2::GoogleCloudRetailV2AddFulfillmentPlacesRequest::Representation
357
+ command.request_object = google_cloud_retail_v2_add_fulfillment_places_request_object
358
+ command.response_representation = Google::Apis::RetailV2::GoogleLongrunningOperation::Representation
359
+ command.response_class = Google::Apis::RetailV2::GoogleLongrunningOperation
360
+ command.params['product'] = product unless product.nil?
361
+ command.query['fields'] = fields unless fields.nil?
362
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
363
+ execute_or_queue_command(command, &block)
364
+ end
365
+
166
366
  # Creates a Product.
167
367
  # @param [String] parent
168
368
  # Required. The parent catalog resource name, such as `projects/*/locations/
@@ -315,6 +515,72 @@ module Google
315
515
  execute_or_queue_command(command, &block)
316
516
  end
317
517
 
518
+ # Gets a list of Products.
519
+ # @param [String] parent
520
+ # Required. The parent branch resource name, such as `projects/*/locations/
521
+ # global/catalogs/default_catalog/branches/0`. Use `default_branch` as the
522
+ # branch ID, to list products under the default branch. If the caller does not
523
+ # have permission to list Products under this branch, regardless of whether or
524
+ # not this branch exists, a PERMISSION_DENIED error is returned.
525
+ # @param [String] filter
526
+ # A filter to apply on the list results. Supported features: * List all the
527
+ # products under the parent branch if filter is unset. * List Product.Type.
528
+ # VARIANT Products sharing the same Product.Type.PRIMARY Product. For example: `
529
+ # primary_product_id = "some_product_id"` * List Products bundled in a Product.
530
+ # Type.COLLECTION Product. For example: `collection_product_id = "
531
+ # some_product_id"` * List Products with a partibular type. For example: `type =
532
+ # "PRIMARY"` `type = "VARIANT"` `type = "COLLECTION"` If the field is
533
+ # unrecognizable, an INVALID_ARGUMENT error is returned. If the specified
534
+ # Product.Type.PRIMARY Product or Product.Type.COLLECTION Product does not exist,
535
+ # a NOT_FOUND error is returned.
536
+ # @param [Fixnum] page_size
537
+ # Maximum number of Products to return. If unspecified, defaults to 100. The
538
+ # maximum allowed value is 1000. Values above 1000 will be coerced to 1000. If
539
+ # this field is negative, an INVALID_ARGUMENT error is returned.
540
+ # @param [String] page_token
541
+ # A page token ListProductsResponse.next_page_token, received from a previous
542
+ # ProductService.ListProducts call. Provide this to retrieve the subsequent page.
543
+ # When paginating, all other parameters provided to ProductService.ListProducts
544
+ # must match the call that provided the page token. Otherwise, an
545
+ # INVALID_ARGUMENT error is returned.
546
+ # @param [String] read_mask
547
+ # The fields of Product to return in the responses. If not set or empty, the
548
+ # following fields are returned: * Product.name * Product.id * Product.title *
549
+ # Product.uri * Product.images * Product.price_info * Product.brands If "*" is
550
+ # provided, all fields are returned. Product.name is always returned no matter
551
+ # what mask is set. If an unsupported or unknown field is provided, an
552
+ # INVALID_ARGUMENT error is returned.
553
+ # @param [String] fields
554
+ # Selector specifying which fields to include in a partial response.
555
+ # @param [String] quota_user
556
+ # Available to use for quota purposes for server-side applications. Can be any
557
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
558
+ # @param [Google::Apis::RequestOptions] options
559
+ # Request-specific options
560
+ #
561
+ # @yield [result, err] Result & error if block supplied
562
+ # @yieldparam result [Google::Apis::RetailV2::GoogleCloudRetailV2ListProductsResponse] parsed result object
563
+ # @yieldparam err [StandardError] error object if request failed
564
+ #
565
+ # @return [Google::Apis::RetailV2::GoogleCloudRetailV2ListProductsResponse]
566
+ #
567
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
568
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
569
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
570
+ def list_project_location_catalog_branch_products(parent, filter: nil, page_size: nil, page_token: nil, read_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
571
+ command = make_simple_command(:get, 'v2/{+parent}/products', options)
572
+ command.response_representation = Google::Apis::RetailV2::GoogleCloudRetailV2ListProductsResponse::Representation
573
+ command.response_class = Google::Apis::RetailV2::GoogleCloudRetailV2ListProductsResponse
574
+ command.params['parent'] = parent unless parent.nil?
575
+ command.query['filter'] = filter unless filter.nil?
576
+ command.query['pageSize'] = page_size unless page_size.nil?
577
+ command.query['pageToken'] = page_token unless page_token.nil?
578
+ command.query['readMask'] = read_mask unless read_mask.nil?
579
+ command.query['fields'] = fields unless fields.nil?
580
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
581
+ execute_or_queue_command(command, &block)
582
+ end
583
+
318
584
  # Updates a Product.
319
585
  # @param [String] name
320
586
  # Immutable. Full resource name of the product, such as `projects/*/locations/
@@ -361,6 +627,139 @@ module Google
361
627
  execute_or_queue_command(command, &block)
362
628
  end
363
629
 
630
+ # Incrementally removes place IDs from a Product.fulfillment_info.place_ids.
631
+ # This process is asynchronous and does not require the Product to exist before
632
+ # updating fulfillment information. If the request is valid, the update will be
633
+ # enqueued and processed downstream. As a consequence, when a response is
634
+ # returned, the removed place IDs are not immediately manifested in the Product
635
+ # queried by GetProduct or ListProducts. This feature is only available for
636
+ # users who have Retail Search enabled. Contact Retail Support (retail-search-
637
+ # support@google.com) if you are interested in using Retail Search.
638
+ # @param [String] product
639
+ # Required. Full resource name of Product, such as `projects/*/locations/global/
640
+ # catalogs/default_catalog/branches/default_branch/products/some_product_id`. If
641
+ # the caller does not have permission to access the Product, regardless of
642
+ # whether or not it exists, a PERMISSION_DENIED error is returned.
643
+ # @param [Google::Apis::RetailV2::GoogleCloudRetailV2RemoveFulfillmentPlacesRequest] google_cloud_retail_v2_remove_fulfillment_places_request_object
644
+ # @param [String] fields
645
+ # Selector specifying which fields to include in a partial response.
646
+ # @param [String] quota_user
647
+ # Available to use for quota purposes for server-side applications. Can be any
648
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
649
+ # @param [Google::Apis::RequestOptions] options
650
+ # Request-specific options
651
+ #
652
+ # @yield [result, err] Result & error if block supplied
653
+ # @yieldparam result [Google::Apis::RetailV2::GoogleLongrunningOperation] parsed result object
654
+ # @yieldparam err [StandardError] error object if request failed
655
+ #
656
+ # @return [Google::Apis::RetailV2::GoogleLongrunningOperation]
657
+ #
658
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
659
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
660
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
661
+ def remove_project_location_catalog_branch_product_fulfillment_places(product, google_cloud_retail_v2_remove_fulfillment_places_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
662
+ command = make_simple_command(:post, 'v2/{+product}:removeFulfillmentPlaces', options)
663
+ command.request_representation = Google::Apis::RetailV2::GoogleCloudRetailV2RemoveFulfillmentPlacesRequest::Representation
664
+ command.request_object = google_cloud_retail_v2_remove_fulfillment_places_request_object
665
+ command.response_representation = Google::Apis::RetailV2::GoogleLongrunningOperation::Representation
666
+ command.response_class = Google::Apis::RetailV2::GoogleLongrunningOperation
667
+ command.params['product'] = product unless product.nil?
668
+ command.query['fields'] = fields unless fields.nil?
669
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
670
+ execute_or_queue_command(command, &block)
671
+ end
672
+
673
+ # Updates inventory information for a Product while respecting the last update
674
+ # timestamps of each inventory field. This process is asynchronous and does not
675
+ # require the Product to exist before updating fulfillment information. If the
676
+ # request is valid, the update will be enqueued and processed downstream. As a
677
+ # consequence, when a response is returned, updates are not immediately
678
+ # manifested in the Product queried by GetProduct or ListProducts. When
679
+ # inventory is updated with CreateProduct and UpdateProduct, the specified
680
+ # inventory field value(s) will overwrite any existing value(s) while ignoring
681
+ # the last update time for this field. Furthermore, the last update time for the
682
+ # specified inventory fields will be overwritten to the time of the
683
+ # CreateProduct or UpdateProduct request. If no inventory fields are set in
684
+ # CreateProductRequest.product, then any pre-existing inventory information for
685
+ # this product will be used. If no inventory fields are set in
686
+ # UpdateProductRequest.set_mask, then any existing inventory information will be
687
+ # preserved. Pre-existing inventory information can only be updated with
688
+ # SetInventory, AddFulfillmentPlaces, and RemoveFulfillmentPlaces. This feature
689
+ # is only available for users who have Retail Search enabled. Contact Retail
690
+ # Support (retail-search-support@google.com) if you are interested in using
691
+ # Retail Search.
692
+ # @param [String] name
693
+ # Immutable. Full resource name of the product, such as `projects/*/locations/
694
+ # global/catalogs/default_catalog/branches/default_branch/products/product_id`.
695
+ # The branch ID must be "default_branch".
696
+ # @param [Google::Apis::RetailV2::GoogleCloudRetailV2SetInventoryRequest] google_cloud_retail_v2_set_inventory_request_object
697
+ # @param [String] fields
698
+ # Selector specifying which fields to include in a partial response.
699
+ # @param [String] quota_user
700
+ # Available to use for quota purposes for server-side applications. Can be any
701
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
702
+ # @param [Google::Apis::RequestOptions] options
703
+ # Request-specific options
704
+ #
705
+ # @yield [result, err] Result & error if block supplied
706
+ # @yieldparam result [Google::Apis::RetailV2::GoogleLongrunningOperation] parsed result object
707
+ # @yieldparam err [StandardError] error object if request failed
708
+ #
709
+ # @return [Google::Apis::RetailV2::GoogleLongrunningOperation]
710
+ #
711
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
712
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
713
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
714
+ def set_project_location_catalog_branch_product_inventory(name, google_cloud_retail_v2_set_inventory_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
715
+ command = make_simple_command(:post, 'v2/{+name}:setInventory', options)
716
+ command.request_representation = Google::Apis::RetailV2::GoogleCloudRetailV2SetInventoryRequest::Representation
717
+ command.request_object = google_cloud_retail_v2_set_inventory_request_object
718
+ command.response_representation = Google::Apis::RetailV2::GoogleLongrunningOperation::Representation
719
+ command.response_class = Google::Apis::RetailV2::GoogleLongrunningOperation
720
+ command.params['name'] = name unless name.nil?
721
+ command.query['fields'] = fields unless fields.nil?
722
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
723
+ execute_or_queue_command(command, &block)
724
+ end
725
+
726
+ # Bulk import of processed completion dataset. Request processing may be
727
+ # synchronous. Partial updating is not supported. This feature is only available
728
+ # for users who have Retail Search enabled. Contact Retail Support (retail-
729
+ # search-support@google.com) if you are interested in using Retail Search.
730
+ # @param [String] parent
731
+ # Required. The catalog which the suggestions dataset belongs to. Format: `
732
+ # projects/1234/locations/global/catalogs/default_catalog`.
733
+ # @param [Google::Apis::RetailV2::GoogleCloudRetailV2ImportCompletionDataRequest] google_cloud_retail_v2_import_completion_data_request_object
734
+ # @param [String] fields
735
+ # Selector specifying which fields to include in a partial response.
736
+ # @param [String] quota_user
737
+ # Available to use for quota purposes for server-side applications. Can be any
738
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
739
+ # @param [Google::Apis::RequestOptions] options
740
+ # Request-specific options
741
+ #
742
+ # @yield [result, err] Result & error if block supplied
743
+ # @yieldparam result [Google::Apis::RetailV2::GoogleLongrunningOperation] parsed result object
744
+ # @yieldparam err [StandardError] error object if request failed
745
+ #
746
+ # @return [Google::Apis::RetailV2::GoogleLongrunningOperation]
747
+ #
748
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
749
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
750
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
751
+ def import_project_location_catalog_completion_datum(parent, google_cloud_retail_v2_import_completion_data_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
752
+ command = make_simple_command(:post, 'v2/{+parent}/completionData:import', options)
753
+ command.request_representation = Google::Apis::RetailV2::GoogleCloudRetailV2ImportCompletionDataRequest::Representation
754
+ command.request_object = google_cloud_retail_v2_import_completion_data_request_object
755
+ command.response_representation = Google::Apis::RetailV2::GoogleLongrunningOperation::Representation
756
+ command.response_class = Google::Apis::RetailV2::GoogleLongrunningOperation
757
+ command.params['parent'] = parent unless parent.nil?
758
+ command.query['fields'] = fields unless fields.nil?
759
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
760
+ execute_or_queue_command(command, &block)
761
+ end
762
+
364
763
  # Gets the latest state of a long-running operation. Clients can use this method
365
764
  # to poll the operation result at intervals as recommended by the API service.
366
765
  # @param [String] name
@@ -477,6 +876,45 @@ module Google
477
876
  execute_or_queue_command(command, &block)
478
877
  end
479
878
 
879
+ # Performs a search. This feature is only available for users who have Retail
880
+ # Search enabled. Contact Retail Support (retail-search-support@google.com) if
881
+ # you are interested in using Retail Search.
882
+ # @param [String] placement
883
+ # Required. The resource name of the search engine placement, such as `projects/*
884
+ # /locations/global/catalogs/default_catalog/placements/default_search`. This
885
+ # field is used to identify the set of models that will be used to make the
886
+ # search. We currently support one placement with the following ID: * `
887
+ # default_search`.
888
+ # @param [Google::Apis::RetailV2::GoogleCloudRetailV2SearchRequest] google_cloud_retail_v2_search_request_object
889
+ # @param [String] fields
890
+ # Selector specifying which fields to include in a partial response.
891
+ # @param [String] quota_user
892
+ # Available to use for quota purposes for server-side applications. Can be any
893
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
894
+ # @param [Google::Apis::RequestOptions] options
895
+ # Request-specific options
896
+ #
897
+ # @yield [result, err] Result & error if block supplied
898
+ # @yieldparam result [Google::Apis::RetailV2::GoogleCloudRetailV2SearchResponse] parsed result object
899
+ # @yieldparam err [StandardError] error object if request failed
900
+ #
901
+ # @return [Google::Apis::RetailV2::GoogleCloudRetailV2SearchResponse]
902
+ #
903
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
904
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
905
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
906
+ def search_project_location_catalog_placements(placement, google_cloud_retail_v2_search_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
907
+ command = make_simple_command(:post, 'v2/{+placement}:search', options)
908
+ command.request_representation = Google::Apis::RetailV2::GoogleCloudRetailV2SearchRequest::Representation
909
+ command.request_object = google_cloud_retail_v2_search_request_object
910
+ command.response_representation = Google::Apis::RetailV2::GoogleCloudRetailV2SearchResponse::Representation
911
+ command.response_class = Google::Apis::RetailV2::GoogleCloudRetailV2SearchResponse
912
+ command.params['placement'] = placement unless placement.nil?
913
+ command.query['fields'] = fields unless fields.nil?
914
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
915
+ execute_or_queue_command(command, &block)
916
+ end
917
+
480
918
  # Writes a single user event from the browser. This uses a GET request to due to
481
919
  # browser restriction of POST-ing to a 3rd party domain. This method is used
482
920
  # only by the Retail API JavaScript pixel and Google Tag Manager. Users should