class Google::Apis::RetailV2alpha::CloudRetailService

Retail API

Cloud Retail service enables customers to build end-to-end personalized

recommendation systems without requiring a high level of expertise in machine
learning, recommendation system, or Google Cloud.

@example

require 'google/apis/retail_v2alpha'

Retail = Google::Apis::RetailV2alpha # Alias the module
service = Retail::CloudRetailService.new

@see cloud.google.com/recommendations

Attributes

key[RW]

@return [String]

API key. Your API key identifies your project and provides you with API access,
quota, and reports. Required unless you provide an OAuth 2.0 token.
quota_user[RW]

@return [String]

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/google/apis/retail_v2alpha/service.rb, line 47
def initialize
  super('https://retail.googleapis.com/', '',
        client_name: 'google-apis-retail_v2alpha',
        client_version: Google::Apis::RetailV2alpha::GEM_VERSION)
  @batch_path = 'batch'
end

Public Instance Methods

add_project_location_catalog_branch_product_fulfillment_places(product, google_cloud_retail_v2alpha_add_fulfillment_places_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Incrementally adds place IDs to Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the Product queried by GetProduct or ListProducts. This feature is only available for users who have Retail Search enabled. Please submit a form [here](https:// cloud.google.com/contact) to contact cloud sales if you are interested in using Retail Search. @param [String] product

Required. Full resource name of Product, such as `projects/*/locations/global/
catalogs/default_catalog/branches/default_branch/products/some_product_id`. If
the caller does not have permission to access the Product, regardless of
whether or not it exists, a PERMISSION_DENIED error is returned.

@param [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaAddFulfillmentPlacesRequest] google_cloud_retail_v2alpha_add_fulfillment_places_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleLongrunningOperation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleLongrunningOperation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 358
def add_project_location_catalog_branch_product_fulfillment_places(product, google_cloud_retail_v2alpha_add_fulfillment_places_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2alpha/{+product}:addFulfillmentPlaces', options)
  command.request_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaAddFulfillmentPlacesRequest::Representation
  command.request_object = google_cloud_retail_v2alpha_add_fulfillment_places_request_object
  command.response_representation = Google::Apis::RetailV2alpha::GoogleLongrunningOperation::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleLongrunningOperation
  command.params['product'] = product unless product.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
collect_project_location_catalog_user_event(parent, ets: nil, uri: nil, user_event: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Writes a single user event from the browser. This uses a GET request to due to browser restriction of POST-ing to a 3rd party domain. This method is used only by the Retail API JavaScript pixel and Google Tag Manager. Users should not call this method directly. @param [String] parent

Required. The parent catalog name, such as `projects/1234/locations/global/
catalogs/default_catalog`.

@param [Fixnum] ets

The event timestamp in milliseconds. This prevents browser caching of
otherwise identical get requests. The name is abbreviated to reduce the
payload bytes.

@param [String] uri

The URL including cgi-parameters but excluding the hash fragment with a length
limit of 5,000 characters. This is often more useful than the referer URL,
because many browsers only send the domain for 3rd party requests.

@param [String] user_event

Required. URL encoded UserEvent proto with a length limit of 2,000,000
characters.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleApiHttpBody] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleApiHttpBody]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 964
def collect_project_location_catalog_user_event(parent, ets: nil, uri: nil, user_event: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2alpha/{+parent}/userEvents:collect', options)
  command.response_representation = Google::Apis::RetailV2alpha::GoogleApiHttpBody::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleApiHttpBody
  command.params['parent'] = parent unless parent.nil?
  command.query['ets'] = ets unless ets.nil?
  command.query['uri'] = uri unless uri.nil?
  command.query['userEvent'] = user_event unless user_event.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
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) click to toggle source

Completes the specified prefix with keyword suggestions. This feature is only available for users who have Retail Search enabled. Please submit a form [here] (cloud.google.com/contact) to contact cloud sales if you are interested in using Retail Search. @param [String] catalog

Required. Catalog for which the completion is performed. Full resource name of
catalog, such as `projects/*/locations/global/catalogs/default_catalog`.

@param [String] dataset

Determines which dataset to use for fetching completion. "user-data" will use
the imported dataset through CompletionService.ImportCompletionData. "cloud-
retail" will use the dataset generated by cloud retail based on user events.
If leave empty, it will use the "user-data". Current supported values: * user-
data * cloud-retail This option requires additional allowlisting. Before using
cloud-retail, contact Cloud Retail support team first.

@param [String] device_type

The device type context for completion suggestions. It is useful to apply
different suggestions on different device types, e.g. DESKTOP, MOBILE. If it
is empty, the suggestions are across all device types. Supported formats: *
UNKNOWN_DEVICE_TYPE * DESKTOP * MOBILE * A customized string starts with
OTHER_, e.g. OTHER_IPHONE.

@param [Array<String>, String] language_codes

The list of languages of the query. This is the BCP-47 language code, such as "
en-US" or "sr-Latn". For more information, see [Tags for Identifying Languages]
(https://tools.ietf.org/html/bcp47). The maximum number of allowed characters
is 255. Only "en-US" is currently supported.

@param [Fixnum] max_suggestions

Completion max suggestions. If left unset or set to 0, then will fallback to
the configured value CompletionConfig.max_suggestions. The maximum allowed max
suggestions is 20. If it is set higher, it will be capped by 20.

@param [String] query

Required. The query used to generate suggestions. The maximum number of
allowed characters is 255

@param [String] visitor_id

A unique identifier for tracking visitors. For example, this could be
implemented with an HTTP cookie, which should be able to uniquely identify a
visitor on a single device. This unique identifier should not change if the
visitor logs in or out of the website. The field must be a UTF-8 encoded
string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT
error is returned.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaCompleteQueryResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaCompleteQueryResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 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)
  command = make_simple_command(:get, 'v2alpha/{+catalog}:completeQuery', options)
  command.response_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaCompleteQueryResponse::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaCompleteQueryResponse
  command.params['catalog'] = catalog unless catalog.nil?
  command.query['dataset'] = dataset unless dataset.nil?
  command.query['deviceType'] = device_type unless device_type.nil?
  command.query['languageCodes'] = language_codes unless language_codes.nil?
  command.query['maxSuggestions'] = max_suggestions unless max_suggestions.nil?
  command.query['query'] = query unless query.nil?
  command.query['visitorId'] = visitor_id unless visitor_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
create_project_location_catalog_branch_product(parent, google_cloud_retail_v2alpha_product_object = nil, product_id: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Creates a Product. @param [String] parent

Required. The parent catalog resource name, such as `projects/*/locations/
global/catalogs/default_catalog/branches/default_branch`.

@param [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaProduct] google_cloud_retail_v2alpha_product_object @param [String] product_id

Required. The ID to use for the Product, which will become the final component
of the Product.name. If the caller does not have permission to create the
Product, regardless of whether or not it exists, a PERMISSION_DENIED error is
returned. This field must be unique among all Products with the same parent.
Otherwise, an ALREADY_EXISTS error is returned. This field must be a UTF-8
encoded string with a length limit of 128 characters. Otherwise, an
INVALID_ARGUMENT error is returned.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaProduct] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaProduct]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 400
def create_project_location_catalog_branch_product(parent, google_cloud_retail_v2alpha_product_object = nil, product_id: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2alpha/{+parent}/products', options)
  command.request_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaProduct::Representation
  command.request_object = google_cloud_retail_v2alpha_product_object
  command.response_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaProduct::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaProduct
  command.params['parent'] = parent unless parent.nil?
  command.query['productId'] = product_id unless product_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
delete_project_location_catalog_branch_product(name, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Deletes a Product. @param [String] name

Required. Full resource name of Product, such as `projects/*/locations/global/
catalogs/default_catalog/branches/default_branch/products/some_product_id`. If
the caller does not have permission to delete the Product, regardless of
whether or not it exists, a PERMISSION_DENIED error is returned. If the
Product to delete does not exist, a NOT_FOUND error is returned. The Product
to delete can neither be a Product.Type.COLLECTION Product member nor a
Product.Type.PRIMARY Product with more than one variants. Otherwise, an
INVALID_ARGUMENT error is returned. All inventory information for the named
Product will be deleted.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleProtobufEmpty] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleProtobufEmpty]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 441
def delete_project_location_catalog_branch_product(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v2alpha/{+name}', options)
  command.response_representation = Google::Apis::RetailV2alpha::GoogleProtobufEmpty::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleProtobufEmpty
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
get_project_location_catalog_branch_operation(name, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. @param [String] name

The name of the operation resource.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleLongrunningOperation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleLongrunningOperation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 316
def get_project_location_catalog_branch_operation(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2alpha/{+name}', options)
  command.response_representation = Google::Apis::RetailV2alpha::GoogleLongrunningOperation::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleLongrunningOperation
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
get_project_location_catalog_branch_product(name, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Gets a Product. @param [String] name

Required. Full resource name of Product, such as `projects/*/locations/global/
catalogs/default_catalog/branches/default_branch/products/some_product_id`. If
the caller does not have permission to access the Product, regardless of
whether or not it exists, a PERMISSION_DENIED error is returned. If the
requested Product does not exist, a NOT_FOUND error is returned.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaProduct] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaProduct]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 475
def get_project_location_catalog_branch_product(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2alpha/{+name}', options)
  command.response_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaProduct::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaProduct
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
get_project_location_catalog_default_branch(catalog, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Get which branch is currently default branch set by CatalogService. SetDefaultBranch method under a specified parent catalog. This feature is only available for users who have Retail Search enabled. Please submit a form [here] (cloud.google.com/contact) to contact cloud sales if you are interested in using Retail Search. @param [String] catalog

The parent catalog resource name, such as `projects/*/locations/global/
catalogs/default_catalog`.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaGetDefaultBranchResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaGetDefaultBranchResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 151
def get_project_location_catalog_default_branch(catalog, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2alpha/{+catalog}:getDefaultBranch', options)
  command.response_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaGetDefaultBranchResponse::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaGetDefaultBranchResponse
  command.params['catalog'] = catalog unless catalog.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
get_project_location_catalog_operation(name, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. @param [String] name

The name of the operation resource.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleLongrunningOperation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleLongrunningOperation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 795
def get_project_location_catalog_operation(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2alpha/{+name}', options)
  command.response_representation = Google::Apis::RetailV2alpha::GoogleLongrunningOperation::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleLongrunningOperation
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
get_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. @param [String] name

The name of the operation resource.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleLongrunningOperation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleLongrunningOperation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 1146
def get_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2alpha/{+name}', options)
  command.response_representation = Google::Apis::RetailV2alpha::GoogleLongrunningOperation::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleLongrunningOperation
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
import_project_location_catalog_branch_product(parent, google_cloud_retail_v2alpha_import_products_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Bulk import of multiple Products. Request processing may be synchronous. No partial updating is supported. Non-existing items are created. Note that it is possible for a subset of the Products to be successfully updated. @param [String] parent

Required. `projects/1234/locations/global/catalogs/default_catalog/branches/
default_branch` If no updateMask is specified, requires products.create
permission. If updateMask is specified, requires products.update permission.

@param [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaImportProductsRequest] google_cloud_retail_v2alpha_import_products_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleLongrunningOperation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleLongrunningOperation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 510
def import_project_location_catalog_branch_product(parent, google_cloud_retail_v2alpha_import_products_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2alpha/{+parent}/products:import', options)
  command.request_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaImportProductsRequest::Representation
  command.request_object = google_cloud_retail_v2alpha_import_products_request_object
  command.response_representation = Google::Apis::RetailV2alpha::GoogleLongrunningOperation::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleLongrunningOperation
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
import_project_location_catalog_completion_datum(parent, google_cloud_retail_v2alpha_import_completion_data_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Bulk import of processed completion dataset. Request processing may be synchronous. Partial updating is not supported. This feature is only available for users who have Retail Search enabled. Please submit a form [here](https:// cloud.google.com/contact) to contact cloud sales if you are interested in using Retail Search. @param [String] parent

Required. The catalog which the suggestions dataset belongs to. Format: `
projects/1234/locations/global/catalogs/default_catalog`.

@param [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaImportCompletionDataRequest] google_cloud_retail_v2alpha_import_completion_data_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleLongrunningOperation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleLongrunningOperation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 762
def import_project_location_catalog_completion_datum(parent, google_cloud_retail_v2alpha_import_completion_data_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2alpha/{+parent}/completionData:import', options)
  command.request_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaImportCompletionDataRequest::Representation
  command.request_object = google_cloud_retail_v2alpha_import_completion_data_request_object
  command.response_representation = Google::Apis::RetailV2alpha::GoogleLongrunningOperation::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleLongrunningOperation
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
import_project_location_catalog_user_event(parent, google_cloud_retail_v2alpha_import_user_events_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Bulk import of User events. Request processing might be synchronous. Events that already exist are skipped. Use this method for backfilling historical user events. Operation.response is of type ImportResponse. Note that it is possible for a subset of the items to be successfully inserted. Operation. metadata is of type ImportMetadata. @param [String] parent

Required. `projects/1234/locations/global/catalogs/default_catalog`

@param [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaImportUserEventsRequest] google_cloud_retail_v2alpha_import_user_events_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleLongrunningOperation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleLongrunningOperation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 1002
def import_project_location_catalog_user_event(parent, google_cloud_retail_v2alpha_import_user_events_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2alpha/{+parent}/userEvents:import', options)
  command.request_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaImportUserEventsRequest::Representation
  command.request_object = google_cloud_retail_v2alpha_import_user_events_request_object
  command.response_representation = Google::Apis::RetailV2alpha::GoogleLongrunningOperation::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleLongrunningOperation
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
list_project_location_catalog_branch_products(parent, filter: nil, page_size: nil, page_token: nil, read_mask: nil, require_total_size: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Gets a list of Products. @param [String] parent

Required. The parent branch resource name, such as `projects/*/locations/
global/catalogs/default_catalog/branches/0`. Use `default_branch` as the
branch ID, to list products under the default branch. If the caller does not
have permission to list Products under this branch, regardless of whether or
not this branch exists, a PERMISSION_DENIED error is returned.

@param [String] filter

A filter to apply on the list results. Supported features: * List all the
products under the parent branch if filter is unset. * List Product.Type.
VARIANT Products sharing the same Product.Type.PRIMARY Product. For example: `
primary_product_id = "some_product_id"` * List Products bundled in a Product.
Type.COLLECTION Product. For example: `collection_product_id = "
some_product_id"` * List Products with a partibular type. For example: `type =
"PRIMARY"` `type = "VARIANT"` `type = "COLLECTION"` If the field is
unrecognizable, an INVALID_ARGUMENT error is returned. If the specified
Product.Type.PRIMARY Product or Product.Type.COLLECTION Product does not exist,
a NOT_FOUND error is returned.

@param [Fixnum] page_size

Maximum number of Products to return. If unspecified, defaults to 100. The
maximum allowed value is 1000. Values above 1000 will be coerced to 1000. If
this field is negative, an INVALID_ARGUMENT error is returned.

@param [String] page_token

A page token ListProductsResponse.next_page_token, received from a previous
ProductService.ListProducts call. Provide this to retrieve the subsequent page.
When paginating, all other parameters provided to ProductService.ListProducts
must match the call that provided the page token. Otherwise, an
INVALID_ARGUMENT error is returned.

@param [String] read_mask

The fields of Product to return in the responses. If not set or empty, the
following fields are returned: * Product.name * Product.id * Product.title *
Product.uri * Product.images * Product.price_info * Product.brands If "*" is
provided, all fields are returned. Product.name is always returned no matter
what mask is set. If an unsupported or unknown field is provided, an
INVALID_ARGUMENT error is returned.

@param [Boolean] require_total_size

If true and page_token is empty, ListProductsResponse.total_size is set to the
total count of matched items irrespective of pagination. Notice that setting
this field to true affects the performance.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaListProductsResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaListProductsResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 578
def list_project_location_catalog_branch_products(parent, filter: nil, page_size: nil, page_token: nil, read_mask: nil, require_total_size: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2alpha/{+parent}/products', options)
  command.response_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaListProductsResponse::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaListProductsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['readMask'] = read_mask unless read_mask.nil?
  command.query['requireTotalSize'] = require_total_size unless require_total_size.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
list_project_location_catalog_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `“/v1/`name=users/*`/operations”` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. @param [String] name

The name of the operation's parent resource.

@param [String] filter

The standard list filter.

@param [Fixnum] page_size

The standard list page size.

@param [String] page_token

The standard list page token.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleLongrunningListOperationsResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleLongrunningListOperationsResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 838
def list_project_location_catalog_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2alpha/{+name}/operations', options)
  command.response_representation = Google::Apis::RetailV2alpha::GoogleLongrunningListOperationsResponse::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleLongrunningListOperationsResponse
  command.params['name'] = name unless name.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
list_project_location_catalogs(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Lists all the Catalogs associated with the project. @param [String] parent

Required. The account resource name with an associated location. If the caller
does not have permission to list Catalogs under this location, regardless of
whether or not this location exists, a PERMISSION_DENIED error is returned.

@param [Fixnum] page_size

Maximum number of Catalogs to return. If unspecified, defaults to 50. The
maximum allowed value is 1000. Values above 1000 will be coerced to 1000. If
this field is negative, an INVALID_ARGUMENT is returned.

@param [String] page_token

A page token ListCatalogsResponse.next_page_token, received from a previous
CatalogService.ListCatalogs call. Provide this to retrieve the subsequent page.
When paginating, all other parameters provided to CatalogService.ListCatalogs
must match the call that provided the page token. Otherwise, an
INVALID_ARGUMENT error is returned.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaListCatalogsResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaListCatalogsResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 193
def list_project_location_catalogs(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2alpha/{+parent}/catalogs', options)
  command.response_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaListCatalogsResponse::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaListCatalogsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
list_project_location_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `“/v1/`name=users/*`/operations”` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. @param [String] name

The name of the operation's parent resource.

@param [String] filter

The standard list filter.

@param [Fixnum] page_size

The standard list page size.

@param [String] page_token

The standard list page token.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleLongrunningListOperationsResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleLongrunningListOperationsResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 1189
def list_project_location_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2alpha/{+name}/operations', options)
  command.response_representation = Google::Apis::RetailV2alpha::GoogleLongrunningListOperationsResponse::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleLongrunningListOperationsResponse
  command.params['name'] = name unless name.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
patch_project_location_catalog(name, google_cloud_retail_v2alpha_catalog_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Updates the Catalogs. @param [String] name

Required. Immutable. The fully qualified resource name of the catalog.

@param [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaCatalog] google_cloud_retail_v2alpha_catalog_object @param [String] update_mask

Indicates which fields in the provided Catalog to update. If an unsupported or
unknown field is provided, an INVALID_ARGUMENT error is returned.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaCatalog] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaCatalog]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 229
def patch_project_location_catalog(name, google_cloud_retail_v2alpha_catalog_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v2alpha/{+name}', options)
  command.request_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaCatalog::Representation
  command.request_object = google_cloud_retail_v2alpha_catalog_object
  command.response_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaCatalog::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaCatalog
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
patch_project_location_catalog_branch_product(name, google_cloud_retail_v2alpha_product_object = nil, allow_missing: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Updates a Product. @param [String] name

Immutable. Full resource name of the product, such as `projects/*/locations/
global/catalogs/default_catalog/branches/default_branch/products/product_id`.
The branch ID must be "default_branch".

@param [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaProduct] google_cloud_retail_v2alpha_product_object @param [Boolean] allow_missing

If set to true, and the Product is not found, a new Product will be created.
In this situation, `update_mask` is ignored.

@param [String] update_mask

Indicates which fields in the provided Product to update. The immutable and
output only fields are NOT supported. If not set, all supported fields (the
fields that are neither immutable nor output only) are updated. If an
unsupported or unknown field is provided, an INVALID_ARGUMENT error is
returned.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaProduct] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaProduct]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 625
def patch_project_location_catalog_branch_product(name, google_cloud_retail_v2alpha_product_object = nil, allow_missing: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v2alpha/{+name}', options)
  command.request_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaProduct::Representation
  command.request_object = google_cloud_retail_v2alpha_product_object
  command.response_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaProduct::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaProduct
  command.params['name'] = name unless name.nil?
  command.query['allowMissing'] = allow_missing unless allow_missing.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
predict_project_location_catalog_placement(placement, google_cloud_retail_v2alpha_predict_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Makes a recommendation prediction. @param [String] placement

Required. Full resource name of the format: `name=projects/*/locations/global/
catalogs/default_catalog/placements/*` The ID of the Recommendations AI
placement. Before you can request predictions from your model, you must create
at least one placement for it. For more information, see [Managing placements](
https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
The full list of available placements can be seen at https://console.cloud.
google.com/recommendation/catalogs/default_catalog/placements

@param [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaPredictRequest] google_cloud_retail_v2alpha_predict_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaPredictResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaPredictResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 878
def predict_project_location_catalog_placement(placement, google_cloud_retail_v2alpha_predict_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2alpha/{+placement}:predict', options)
  command.request_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaPredictRequest::Representation
  command.request_object = google_cloud_retail_v2alpha_predict_request_object
  command.response_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaPredictResponse::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaPredictResponse
  command.params['placement'] = placement unless placement.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
purge_project_location_catalog_user_event(parent, google_cloud_retail_v2alpha_purge_user_events_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Deletes permanently all user events specified by the filter provided. Depending on the number of events specified by the filter, this operation could take hours or days to complete. To test a filter, use the list command first. @param [String] parent

Required. The resource name of the catalog under which the events are created.
The format is `projects/$`projectId`/locations/global/catalogs/$`catalogId``

@param [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaPurgeUserEventsRequest] google_cloud_retail_v2alpha_purge_user_events_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleLongrunningOperation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleLongrunningOperation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 1039
def purge_project_location_catalog_user_event(parent, google_cloud_retail_v2alpha_purge_user_events_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2alpha/{+parent}/userEvents:purge', options)
  command.request_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaPurgeUserEventsRequest::Representation
  command.request_object = google_cloud_retail_v2alpha_purge_user_events_request_object
  command.response_representation = Google::Apis::RetailV2alpha::GoogleLongrunningOperation::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleLongrunningOperation
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
rejoin_project_location_catalog_user_event(parent, google_cloud_retail_v2alpha_rejoin_user_events_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Triggers a user event rejoin operation with latest product catalog. Events will not be annotated with detailed product information if product is missing from the catalog at the time the user event is ingested, and these events are stored as unjoined events with a limited usage on training and serving. This API can be used to trigger a 'join' operation on specified events with latest version of product catalog. It can also be used to correct events joined with wrong product catalog. @param [String] parent

Required. The parent catalog resource name, such as `projects/1234/locations/
global/catalogs/default_catalog`.

@param [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaRejoinUserEventsRequest] google_cloud_retail_v2alpha_rejoin_user_events_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleLongrunningOperation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleLongrunningOperation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 1079
def rejoin_project_location_catalog_user_event(parent, google_cloud_retail_v2alpha_rejoin_user_events_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2alpha/{+parent}/userEvents:rejoin', options)
  command.request_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaRejoinUserEventsRequest::Representation
  command.request_object = google_cloud_retail_v2alpha_rejoin_user_events_request_object
  command.response_representation = Google::Apis::RetailV2alpha::GoogleLongrunningOperation::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleLongrunningOperation
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
remove_project_location_catalog_branch_product_fulfillment_places(product, google_cloud_retail_v2alpha_remove_fulfillment_places_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Incrementally removes place IDs from a Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the Product queried by GetProduct or ListProducts. This feature is only available for users who have Retail Search enabled. Please submit a form [here](https:// cloud.google.com/contact) to contact cloud sales if you are interested in using Retail Search. @param [String] product

Required. Full resource name of Product, such as `projects/*/locations/global/
catalogs/default_catalog/branches/default_branch/products/some_product_id`. If
the caller does not have permission to access the Product, regardless of
whether or not it exists, a PERMISSION_DENIED error is returned.

@param [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaRemoveFulfillmentPlacesRequest] google_cloud_retail_v2alpha_remove_fulfillment_places_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleLongrunningOperation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleLongrunningOperation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 671
def remove_project_location_catalog_branch_product_fulfillment_places(product, google_cloud_retail_v2alpha_remove_fulfillment_places_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2alpha/{+product}:removeFulfillmentPlaces', options)
  command.request_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaRemoveFulfillmentPlacesRequest::Representation
  command.request_object = google_cloud_retail_v2alpha_remove_fulfillment_places_request_object
  command.response_representation = Google::Apis::RetailV2alpha::GoogleLongrunningOperation::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleLongrunningOperation
  command.params['product'] = product unless product.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
search_project_location_catalog_placements(placement, google_cloud_retail_v2alpha_search_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Performs a search. This feature is only available for users who have Retail Search enabled. Please submit a form [here](cloud.google.com/contact) to contact cloud sales if you are interested in using Retail Search. @param [String] placement

Required. The resource name of the search engine placement, such as `projects/*
/locations/global/catalogs/default_catalog/placements/default_search`. This
field is used to identify the set of models that will be used to make the
search. We currently support one placement with the following ID: * `
default_search`.

@param [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaSearchRequest] google_cloud_retail_v2alpha_search_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaSearchResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaSearchResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 917
def search_project_location_catalog_placements(placement, google_cloud_retail_v2alpha_search_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2alpha/{+placement}:search', options)
  command.request_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaSearchRequest::Representation
  command.request_object = google_cloud_retail_v2alpha_search_request_object
  command.response_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaSearchResponse::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaSearchResponse
  command.params['placement'] = placement unless placement.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
set_project_location_catalog_branch_product_inventory(name, google_cloud_retail_v2alpha_set_inventory_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by GetProduct or ListProducts. When inventory is updated with CreateProduct and UpdateProduct, the specified inventory field value(s) will overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update time for the specified inventory fields will be overwritten to the time of the CreateProduct or UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product will be used. If no inventory fields are set in UpdateProductRequest.set_mask, then any existing inventory information will be preserved. Pre-existing inventory information can only be updated with SetInventory, AddFulfillmentPlaces, and RemoveFulfillmentPlaces. This feature is only available for users who have Retail Search enabled. Please submit a form [here](cloud.google.com/contact) to contact cloud sales if you are interested in using Retail Search. @param [String] name

Immutable. Full resource name of the product, such as `projects/*/locations/
global/catalogs/default_catalog/branches/default_branch/products/product_id`.
The branch ID must be "default_branch".

@param [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaSetInventoryRequest] google_cloud_retail_v2alpha_set_inventory_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleLongrunningOperation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleLongrunningOperation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 724
def set_project_location_catalog_branch_product_inventory(name, google_cloud_retail_v2alpha_set_inventory_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2alpha/{+name}:setInventory', options)
  command.request_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaSetInventoryRequest::Representation
  command.request_object = google_cloud_retail_v2alpha_set_inventory_request_object
  command.response_representation = Google::Apis::RetailV2alpha::GoogleLongrunningOperation::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleLongrunningOperation
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
set_project_location_catalog_default_branch(catalog, google_cloud_retail_v2alpha_set_default_branch_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Set a specified branch id as default branch. API methods such as SearchService. Search, ProductService.GetProduct, ProductService.ListProducts will treat requests using “default_branch” to the actual branch id set as default. For example, if `projects//locations//catalogs/*/branches/1` is set as default, setting SearchRequest.branch to `projects//locations//catalogs/*/branches/ default_branch` is equivalent to setting SearchRequest.branch to `projects/*/ locations//catalogs//branches/1`. Using multiple branches can be useful when developers would like to have a staging branch to test and verify for future usage. When it becomes ready, developers switch on the staging branch using this API while keeping using `projects//locations//catalogs/*/branches/ default_branch` as SearchRequest.branch to route the traffic to this staging branch. CAUTION: If you have live predict/search traffic, switching the default branch could potentially cause outages if the ID space of the new branch is very different from the old one. More specifically: * PredictionService will only return product IDs from branch `newBranch`. * SearchService will only return product IDs from branch `newBranch` (if branch is not explicitly set). * UserEventService will only join events with products from branch `newBranch`. This feature is only available for users who have Retail Search enabled. Please submit a form [here](cloud.google.com/ contact) to contact cloud sales if you are interested in using Retail Search. @param [String] catalog

Full resource name of the catalog, such as `projects/*/locations/global/
catalogs/default_catalog`.

@param [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaSetDefaultBranchRequest] google_cloud_retail_v2alpha_set_default_branch_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleProtobufEmpty] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleProtobufEmpty]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 283
def set_project_location_catalog_default_branch(catalog, google_cloud_retail_v2alpha_set_default_branch_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2alpha/{+catalog}:setDefaultBranch', options)
  command.request_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaSetDefaultBranchRequest::Representation
  command.request_object = google_cloud_retail_v2alpha_set_default_branch_request_object
  command.response_representation = Google::Apis::RetailV2alpha::GoogleProtobufEmpty::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleProtobufEmpty
  command.params['catalog'] = catalog unless catalog.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
write_project_location_catalog_user_event(parent, google_cloud_retail_v2alpha_user_event_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Writes a single user event. @param [String] parent

Required. The parent catalog resource name, such as `projects/1234/locations/
global/catalogs/default_catalog`.

@param [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaUserEvent] google_cloud_retail_v2alpha_user_event_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaUserEvent] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaUserEvent]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/retail_v2alpha/service.rb, line 1113
def write_project_location_catalog_user_event(parent, google_cloud_retail_v2alpha_user_event_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2alpha/{+parent}/userEvents:write', options)
  command.request_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaUserEvent::Representation
  command.request_object = google_cloud_retail_v2alpha_user_event_object
  command.response_representation = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaUserEvent::Representation
  command.response_class = Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaUserEvent
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

Protected Instance Methods

apply_command_defaults(command) click to toggle source
# File lib/google/apis/retail_v2alpha/service.rb, line 1204
def apply_command_defaults(command)
  command.query['key'] = key unless key.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
end