google-apis-retail_v2 0.12.0 → 0.16.0

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