Module: Google::Cloud::Retail
- Defined in:
- lib/google/cloud/retail.rb,
lib/google/cloud/retail/version.rb
Constant Summary collapse
- VERSION =
"1.10.0"
Class Method Summary collapse
-
.analytics_service(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for AnalyticsService.
-
.catalog_service(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for CatalogService.
-
.completion_service(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for CompletionService.
-
.configure {|::Google::Cloud.configure.retail| ... } ⇒ ::Google::Cloud::Config
Configure the google-cloud-retail library.
-
.control_service(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for ControlService.
-
.generative_question_service(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for GenerativeQuestionService.
-
.model_service(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for ModelService.
-
.prediction_service(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for PredictionService.
-
.product_service(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for ProductService.
-
.search_service(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for SearchService.
-
.serving_config_service(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for ServingConfigService.
-
.user_event_service(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for UserEventService.
Class Method Details
.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.
About AnalyticsService
Service for managing & accessing retail search business metric. Retail recommendation business metric is currently not available.
71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/google/cloud/retail.rb', line 71 def self.analytics_service version: :v2, transport: :grpc, &block require "google/cloud/retail/#{version.to_s.downcase}" package_name = Google::Cloud::Retail .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Retail.const_get(package_name).const_get(:AnalyticsService) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.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.
About CatalogService
Service for managing catalog configuration.
105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/google/cloud/retail.rb', line 105 def self.catalog_service version: :v2, transport: :grpc, &block require "google/cloud/retail/#{version.to_s.downcase}" package_name = Google::Cloud::Retail .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Retail.const_get(package_name).const_get(:CatalogService) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.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.
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.
142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/google/cloud/retail.rb', line 142 def self.completion_service version: :v2, transport: :grpc, &block require "google/cloud/retail/#{version.to_s.downcase}" package_name = Google::Cloud::Retail .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Retail.const_get(package_name).const_get(:CompletionService) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.configure {|::Google::Cloud.configure.retail| ... } ⇒ ::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.
469 470 471 472 473 |
# File 'lib/google/cloud/retail.rb', line 469 def self.configure yield ::Google::Cloud.configure.retail if block_given? ::Google::Cloud.configure.retail end |
.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.
About ControlService
Service for modifying Control.
176 177 178 179 180 181 182 183 184 185 186 |
# File 'lib/google/cloud/retail.rb', line 176 def self.control_service version: :v2, transport: :grpc, &block require "google/cloud/retail/#{version.to_s.downcase}" package_name = Google::Cloud::Retail .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Retail.const_get(package_name).const_get(:ControlService) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.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.
About GenerativeQuestionService
Service for managing LLM generated questions in search serving.
210 211 212 213 214 215 216 217 218 219 220 |
# File 'lib/google/cloud/retail.rb', line 210 def self.generative_question_service version: :v2, transport: :grpc, &block require "google/cloud/retail/#{version.to_s.downcase}" package_name = Google::Cloud::Retail .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Retail.const_get(package_name).const_get(:GenerativeQuestionService) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.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.
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.
255 256 257 258 259 260 261 262 263 264 265 |
# File 'lib/google/cloud/retail.rb', line 255 def self.model_service version: :v2, transport: :grpc, &block require "google/cloud/retail/#{version.to_s.downcase}" package_name = Google::Cloud::Retail .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Retail.const_get(package_name).const_get(:ModelService) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.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.
About PredictionService
Service for making recommendation prediction.
289 290 291 292 293 294 295 296 297 298 299 |
# File 'lib/google/cloud/retail.rb', line 289 def self.prediction_service version: :v2, transport: :grpc, &block require "google/cloud/retail/#{version.to_s.downcase}" package_name = Google::Cloud::Retail .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Retail.const_get(package_name).const_get(:PredictionService) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.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.
About ProductService
Service for ingesting Product information of the customer's website.
324 325 326 327 328 329 330 331 332 333 334 |
# File 'lib/google/cloud/retail.rb', line 324 def self.product_service version: :v2, transport: :grpc, &block require "google/cloud/retail/#{version.to_s.downcase}" package_name = Google::Cloud::Retail .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Retail.const_get(package_name).const_get(:ProductService) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.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.
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.
361 362 363 364 365 366 367 368 369 370 371 |
# File 'lib/google/cloud/retail.rb', line 361 def self.search_service version: :v2, transport: :grpc, &block require "google/cloud/retail/#{version.to_s.downcase}" package_name = Google::Cloud::Retail .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Retail.const_get(package_name).const_get(:SearchService) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.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.
About ServingConfigService
Service for modifying ServingConfig.
395 396 397 398 399 400 401 402 403 404 405 |
# File 'lib/google/cloud/retail.rb', line 395 def self.serving_config_service version: :v2, transport: :grpc, &block require "google/cloud/retail/#{version.to_s.downcase}" package_name = Google::Cloud::Retail .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Retail.const_get(package_name).const_get(:ServingConfigService) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.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.
About UserEventService
Service for ingesting end user actions on the customer website.
429 430 431 432 433 434 435 436 437 438 439 |
# File 'lib/google/cloud/retail.rb', line 429 def self.user_event_service version: :v2, transport: :grpc, &block require "google/cloud/retail/#{version.to_s.downcase}" package_name = Google::Cloud::Retail .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Retail.const_get(package_name).const_get(:UserEventService) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |