Retail API - Module Google::Cloud::Retail (v1.11.0)

Reference documentation and code samples for the Retail API module Google::Cloud::Retail.

Methods

.analytics_service

def self.analytics_service(version: :v2, transport: :grpc, &block) -> ::Object

Create a new client object for AnalyticsService.

By default, this returns an instance of Google::Cloud::Retail::V2::AnalyticsService::Client for a gRPC client for version V2 of the API. However, you can specify a different API version by passing it in the version parameter. If the AnalyticsService service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned. You can also specify a different transport by passing :rest or :grpc in the transport parameter.

Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the AnalyticsService service. You can determine whether the method will succeed by calling Retail.analytics_service_available?.

About AnalyticsService

Service for managing & accessing retail search business metric. Retail recommendation business metric is currently not available.

Parameters
  • version (::String, ::Symbol) (defaults to: :v2) — The API version to connect to. Optional. Defaults to :v2.
  • transport (:grpc, :rest) (defaults to: :grpc) — The transport to use. Defaults to :grpc.
Returns
  • (::Object) — A client object for the specified version.

.analytics_service_available?

def self.analytics_service_available?(version: :v2, transport: :grpc) -> boolean

Determines whether the AnalyticsService service is supported by the current client. If true, you can retrieve a client object by calling Retail.analytics_service. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the AnalyticsService service, or if the versioned client gem needs an update to support the AnalyticsService service.

Parameters
  • version (::String, ::Symbol) (defaults to: :v2) — The API version to connect to. Optional. Defaults to :v2.
  • transport (:grpc, :rest) (defaults to: :grpc) — The transport to use. Defaults to :grpc.
Returns
  • (boolean) — Whether the service is available.

.catalog_service

def self.catalog_service(version: :v2, transport: :grpc, &block) -> ::Object

Create a new client object for CatalogService.

By default, this returns an instance of Google::Cloud::Retail::V2::CatalogService::Client for a gRPC client for version V2 of the API. However, you can specify a different API version by passing it in the version parameter. If the CatalogService service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned. You can also specify a different transport by passing :rest or :grpc in the transport parameter.

Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the CatalogService service. You can determine whether the method will succeed by calling Retail.catalog_service_available?.

About CatalogService

Service for managing catalog configuration.

Parameters
  • version (::String, ::Symbol) (defaults to: :v2) — The API version to connect to. Optional. Defaults to :v2.
  • transport (:grpc, :rest) (defaults to: :grpc) — The transport to use. Defaults to :grpc.
Returns
  • (::Object) — A client object for the specified version.

.catalog_service_available?

def self.catalog_service_available?(version: :v2, transport: :grpc) -> boolean

Determines whether the CatalogService service is supported by the current client. If true, you can retrieve a client object by calling Retail.catalog_service. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the CatalogService service, or if the versioned client gem needs an update to support the CatalogService service.

Parameters
  • version (::String, ::Symbol) (defaults to: :v2) — The API version to connect to. Optional. Defaults to :v2.
  • transport (:grpc, :rest) (defaults to: :grpc) — The transport to use. Defaults to :grpc.
Returns
  • (boolean) — Whether the service is available.

.completion_service

def self.completion_service(version: :v2, transport: :grpc, &block) -> ::Object

Create a new client object for CompletionService.

By default, this returns an instance of Google::Cloud::Retail::V2::CompletionService::Client for a gRPC client for version V2 of the API. However, you can specify a different API version by passing it in the version parameter. If the CompletionService service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned. You can also specify a different transport by passing :rest or :grpc in the transport parameter.

Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the CompletionService service. You can determine whether the method will succeed by calling Retail.completion_service_available?.

About CompletionService

Autocomplete service for retail.

This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.

Parameters
  • version (::String, ::Symbol) (defaults to: :v2) — The API version to connect to. Optional. Defaults to :v2.
  • transport (:grpc, :rest) (defaults to: :grpc) — The transport to use. Defaults to :grpc.
Returns
  • (::Object) — A client object for the specified version.

.completion_service_available?

def self.completion_service_available?(version: :v2, transport: :grpc) -> boolean

Determines whether the CompletionService service is supported by the current client. If true, you can retrieve a client object by calling Retail.completion_service. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the CompletionService service, or if the versioned client gem needs an update to support the CompletionService service.

Parameters
  • version (::String, ::Symbol) (defaults to: :v2) — The API version to connect to. Optional. Defaults to :v2.
  • transport (:grpc, :rest) (defaults to: :grpc) — The transport to use. Defaults to :grpc.
Returns
  • (boolean) — Whether the service is available.

.configure

def self.configure() -> ::Google::Cloud::Config

Configure the google-cloud-retail library.

The following configuration parameters are supported:

  • credentials (type: String, Hash, Google::Auth::Credentials) - The path to the keyfile as a String, the contents of the keyfile as a Hash, or a Google::Auth::Credentials object.
  • lib_name (type: String) - The library name as recorded in instrumentation and logging.
  • lib_version (type: String) - The library version as recorded in instrumentation and logging.
  • interceptors (type: Array<GRPC::ClientInterceptor>) - An array of interceptors that are run before calls are executed.
  • timeout (type: Numeric) - Default timeout in seconds.
  • metadata (type: Hash{Symbol=>String}) - Additional headers to be sent with the call.
  • retry_policy (type: Hash) - The retry policy. The value is a hash with the following keys:
    • :initial_delay (type: Numeric) - The initial delay in seconds.
    • :max_delay (type: Numeric) - The max delay in seconds.
    • :multiplier (type: Numeric) - The incremental backoff multiplier.
    • :retry_codes (type: Array<String>) - The error codes that should trigger a retry.
Yields
  • (::Google::Cloud.configure.retail)
Returns
  • (::Google::Cloud::Config) — The default configuration used by this library

.control_service

def self.control_service(version: :v2, transport: :grpc, &block) -> ::Object

Create a new client object for ControlService.

By default, this returns an instance of Google::Cloud::Retail::V2::ControlService::Client for a gRPC client for version V2 of the API. However, you can specify a different API version by passing it in the version parameter. If the ControlService service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned. You can also specify a different transport by passing :rest or :grpc in the transport parameter.

Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the ControlService service. You can determine whether the method will succeed by calling Retail.control_service_available?.

About ControlService

Service for modifying Control.

Parameters
  • version (::String, ::Symbol) (defaults to: :v2) — The API version to connect to. Optional. Defaults to :v2.
  • transport (:grpc, :rest) (defaults to: :grpc) — The transport to use. Defaults to :grpc.
Returns
  • (::Object) — A client object for the specified version.

.control_service_available?

def self.control_service_available?(version: :v2, transport: :grpc) -> boolean

Determines whether the ControlService service is supported by the current client. If true, you can retrieve a client object by calling Retail.control_service. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the ControlService service, or if the versioned client gem needs an update to support the ControlService service.

Parameters
  • version (::String, ::Symbol) (defaults to: :v2) — The API version to connect to. Optional. Defaults to :v2.
  • transport (:grpc, :rest) (defaults to: :grpc) — The transport to use. Defaults to :grpc.
Returns
  • (boolean) — Whether the service is available.

.generative_question_service

def self.generative_question_service(version: :v2, transport: :grpc, &block) -> ::Object

Create a new client object for GenerativeQuestionService.

By default, this returns an instance of Google::Cloud::Retail::V2::GenerativeQuestionService::Client for a gRPC client for version V2 of the API. However, you can specify a different API version by passing it in the version parameter. If the GenerativeQuestionService service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned. You can also specify a different transport by passing :rest or :grpc in the transport parameter.

Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the GenerativeQuestionService service. You can determine whether the method will succeed by calling Retail.generative_question_service_available?.

About GenerativeQuestionService

Service for managing LLM generated questions in search serving.

Parameters
  • version (::String, ::Symbol) (defaults to: :v2) — The API version to connect to. Optional. Defaults to :v2.
  • transport (:grpc, :rest) (defaults to: :grpc) — The transport to use. Defaults to :grpc.
Returns
  • (::Object) — A client object for the specified version.

.generative_question_service_available?

def self.generative_question_service_available?(version: :v2, transport: :grpc) -> boolean

Determines whether the GenerativeQuestionService service is supported by the current client. If true, you can retrieve a client object by calling Retail.generative_question_service. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the GenerativeQuestionService service, or if the versioned client gem needs an update to support the GenerativeQuestionService service.

Parameters
  • version (::String, ::Symbol) (defaults to: :v2) — The API version to connect to. Optional. Defaults to :v2.
  • transport (:grpc, :rest) (defaults to: :grpc) — The transport to use. Defaults to :grpc.
Returns
  • (boolean) — Whether the service is available.

.model_service

def self.model_service(version: :v2, transport: :grpc, &block) -> ::Object

Create a new client object for ModelService.

By default, this returns an instance of Google::Cloud::Retail::V2::ModelService::Client for a gRPC client for version V2 of the API. However, you can specify a different API version by passing it in the version parameter. If the ModelService service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned. You can also specify a different transport by passing :rest or :grpc in the transport parameter.

Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the ModelService service. You can determine whether the method will succeed by calling Retail.model_service_available?.

About ModelService

Service for performing CRUD operations on models. Recommendation models contain all the metadata necessary to generate a set of models for the Predict() API. A model is queried indirectly via a ServingConfig, which associates a model with a given Placement (e.g. Frequently Bought Together on Home Page).

This service allows you to do the following:

  • Initiate training of a model.
  • Pause training of an existing model.
  • List all the available models along with their metadata.
  • Control their tuning schedule.
Parameters
  • version (::String, ::Symbol) (defaults to: :v2) — The API version to connect to. Optional. Defaults to :v2.
  • transport (:grpc, :rest) (defaults to: :grpc) — The transport to use. Defaults to :grpc.
Returns
  • (::Object) — A client object for the specified version.

.model_service_available?

def self.model_service_available?(version: :v2, transport: :grpc) -> boolean

Determines whether the ModelService service is supported by the current client. If true, you can retrieve a client object by calling Retail.model_service. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the ModelService service, or if the versioned client gem needs an update to support the ModelService service.

Parameters
  • version (::String, ::Symbol) (defaults to: :v2) — The API version to connect to. Optional. Defaults to :v2.
  • transport (:grpc, :rest) (defaults to: :grpc) — The transport to use. Defaults to :grpc.
Returns
  • (boolean) — Whether the service is available.

.prediction_service

def self.prediction_service(version: :v2, transport: :grpc, &block) -> ::Object

Create a new client object for PredictionService.

By default, this returns an instance of Google::Cloud::Retail::V2::PredictionService::Client for a gRPC client for version V2 of the API. However, you can specify a different API version by passing it in the version parameter. If the PredictionService service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned. You can also specify a different transport by passing :rest or :grpc in the transport parameter.

Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the PredictionService service. You can determine whether the method will succeed by calling Retail.prediction_service_available?.

About PredictionService

Service for making recommendation prediction.

Parameters
  • version (::String, ::Symbol) (defaults to: :v2) — The API version to connect to. Optional. Defaults to :v2.
  • transport (:grpc, :rest) (defaults to: :grpc) — The transport to use. Defaults to :grpc.
Returns
  • (::Object) — A client object for the specified version.

.prediction_service_available?

def self.prediction_service_available?(version: :v2, transport: :grpc) -> boolean

Determines whether the PredictionService service is supported by the current client. If true, you can retrieve a client object by calling Retail.prediction_service. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the PredictionService service, or if the versioned client gem needs an update to support the PredictionService service.

Parameters
  • version (::String, ::Symbol) (defaults to: :v2) — The API version to connect to. Optional. Defaults to :v2.
  • transport (:grpc, :rest) (defaults to: :grpc) — The transport to use. Defaults to :grpc.
Returns
  • (boolean) — Whether the service is available.

.product_service

def self.product_service(version: :v2, transport: :grpc, &block) -> ::Object

Create a new client object for ProductService.

By default, this returns an instance of Google::Cloud::Retail::V2::ProductService::Client for a gRPC client for version V2 of the API. However, you can specify a different API version by passing it in the version parameter. If the ProductService service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned. You can also specify a different transport by passing :rest or :grpc in the transport parameter.

Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the ProductService service. You can determine whether the method will succeed by calling Retail.product_service_available?.

About ProductService

Service for ingesting Product information of the customer's website.

Parameters
  • version (::String, ::Symbol) (defaults to: :v2) — The API version to connect to. Optional. Defaults to :v2.
  • transport (:grpc, :rest) (defaults to: :grpc) — The transport to use. Defaults to :grpc.
Returns
  • (::Object) — A client object for the specified version.

.product_service_available?

def self.product_service_available?(version: :v2, transport: :grpc) -> boolean

Determines whether the ProductService service is supported by the current client. If true, you can retrieve a client object by calling Retail.product_service. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the ProductService service, or if the versioned client gem needs an update to support the ProductService service.

Parameters
  • version (::String, ::Symbol) (defaults to: :v2) — The API version to connect to. Optional. Defaults to :v2.
  • transport (:grpc, :rest) (defaults to: :grpc) — The transport to use. Defaults to :grpc.
Returns
  • (boolean) — Whether the service is available.

.search_service

def self.search_service(version: :v2, transport: :grpc, &block) -> ::Object

Create a new client object for SearchService.

By default, this returns an instance of Google::Cloud::Retail::V2::SearchService::Client for a gRPC client for version V2 of the API. However, you can specify a different API version by passing it in the version parameter. If the SearchService service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned. You can also specify a different transport by passing :rest or :grpc in the transport parameter.

Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the SearchService service. You can determine whether the method will succeed by calling Retail.search_service_available?.

About SearchService

Service for search.

This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.

Parameters
  • version (::String, ::Symbol) (defaults to: :v2) — The API version to connect to. Optional. Defaults to :v2.
  • transport (:grpc, :rest) (defaults to: :grpc) — The transport to use. Defaults to :grpc.
Returns
  • (::Object) — A client object for the specified version.

.search_service_available?

def self.search_service_available?(version: :v2, transport: :grpc) -> boolean

Determines whether the SearchService service is supported by the current client. If true, you can retrieve a client object by calling Retail.search_service. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the SearchService service, or if the versioned client gem needs an update to support the SearchService service.

Parameters
  • version (::String, ::Symbol) (defaults to: :v2) — The API version to connect to. Optional. Defaults to :v2.
  • transport (:grpc, :rest) (defaults to: :grpc) — The transport to use. Defaults to :grpc.
Returns
  • (boolean) — Whether the service is available.

.serving_config_service

def self.serving_config_service(version: :v2, transport: :grpc, &block) -> ::Object

Create a new client object for ServingConfigService.

By default, this returns an instance of Google::Cloud::Retail::V2::ServingConfigService::Client for a gRPC client for version V2 of the API. However, you can specify a different API version by passing it in the version parameter. If the ServingConfigService service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned. You can also specify a different transport by passing :rest or :grpc in the transport parameter.

Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the ServingConfigService service. You can determine whether the method will succeed by calling Retail.serving_config_service_available?.

About ServingConfigService

Service for modifying ServingConfig.

Parameters
  • version (::String, ::Symbol) (defaults to: :v2) — The API version to connect to. Optional. Defaults to :v2.
  • transport (:grpc, :rest) (defaults to: :grpc) — The transport to use. Defaults to :grpc.
Returns
  • (::Object) — A client object for the specified version.

.serving_config_service_available?

def self.serving_config_service_available?(version: :v2, transport: :grpc) -> boolean

Determines whether the ServingConfigService service is supported by the current client. If true, you can retrieve a client object by calling Retail.serving_config_service. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the ServingConfigService service, or if the versioned client gem needs an update to support the ServingConfigService service.

Parameters
  • version (::String, ::Symbol) (defaults to: :v2) — The API version to connect to. Optional. Defaults to :v2.
  • transport (:grpc, :rest) (defaults to: :grpc) — The transport to use. Defaults to :grpc.
Returns
  • (boolean) — Whether the service is available.

.user_event_service

def self.user_event_service(version: :v2, transport: :grpc, &block) -> ::Object

Create a new client object for UserEventService.

By default, this returns an instance of Google::Cloud::Retail::V2::UserEventService::Client for a gRPC client for version V2 of the API. However, you can specify a different API version by passing it in the version parameter. If the UserEventService service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned. You can also specify a different transport by passing :rest or :grpc in the transport parameter.

Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the UserEventService service. You can determine whether the method will succeed by calling Retail.user_event_service_available?.

About UserEventService

Service for ingesting end user actions on the customer website.

Parameters
  • version (::String, ::Symbol) (defaults to: :v2) — The API version to connect to. Optional. Defaults to :v2.
  • transport (:grpc, :rest) (defaults to: :grpc) — The transport to use. Defaults to :grpc.
Returns
  • (::Object) — A client object for the specified version.

.user_event_service_available?

def self.user_event_service_available?(version: :v2, transport: :grpc) -> boolean

Determines whether the UserEventService service is supported by the current client. If true, you can retrieve a client object by calling Retail.user_event_service. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the UserEventService service, or if the versioned client gem needs an update to support the UserEventService service.

Parameters
  • version (::String, ::Symbol) (defaults to: :v2) — The API version to connect to. Optional. Defaults to :v2.
  • transport (:grpc, :rest) (defaults to: :grpc) — The transport to use. Defaults to :grpc.
Returns
  • (boolean) — Whether the service is available.

Constants

VERSION

value: "1.11.0"