Retail V2 API - Class Google::Cloud::Retail::V2::AnalyticsService::Client (v0.21.0)

Reference documentation and code samples for the Retail V2 API class Google::Cloud::Retail::V2::AnalyticsService::Client.

Client for the AnalyticsService service.

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

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the AnalyticsService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all AnalyticsService clients
::Google::Cloud::Retail::V2::AnalyticsService::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the AnalyticsService Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#export_analytics_metrics

def export_analytics_metrics(request, options = nil) -> ::Gapic::Operation
def export_analytics_metrics(catalog: nil, output_config: nil, filter: nil) -> ::Gapic::Operation

Exports analytics metrics.

Operation.response is of type ExportAnalyticsMetricsResponse. Operation.metadata is of type ExportMetadata.

Overloads
def export_analytics_metrics(request, options = nil) -> ::Gapic::Operation
Pass arguments to export_analytics_metrics via a request object, either of type ExportAnalyticsMetricsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def export_analytics_metrics(catalog: nil, output_config: nil, filter: nil) -> ::Gapic::Operation
Pass arguments to export_analytics_metrics via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • catalog (::String) — Required. Full resource name of the parent catalog. Expected format: projects/*/locations/*/catalogs/*
  • output_config (::Google::Cloud::Retail::V2::OutputConfig, ::Hash) — Required. The output location of the data.
  • filter (::String) —

    A filtering expression to specify restrictions on returned metrics. The expression is a sequence of terms. Each term applies a restriction to the returned metrics. Use this expression to restrict results to a specific time range.

    Currently we expect only one types of fields:

    • timestamp: This can be specified twice, once with a less than operator and once with a greater than operator. The timestamp restriction should result in one, contiguous, valid, timestamp range.

    Some examples of valid filters expressions:

    • Example 1: timestamp > "2012-04-23T18:25:43.511Z" timestamp < "2012-04-23T18:30:43.511Z"
    • Example 2: timestamp > "2012-04-23T18:25:43.511Z"
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/retail/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Retail::V2::AnalyticsService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest.new

# Call the export_analytics_metrics method.
result = client.export_analytics_metrics request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#initialize

def initialize() { |config| ... } -> Client

Create a new AnalyticsService client object.

Yields
  • (config) — Configure the AnalyticsService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new do |config|
  config.timeout = 10.0
end

#location_client

def location_client() -> Google::Cloud::Location::Locations::Client

Get the associated client for mix-in of the Locations.

Returns
  • (Google::Cloud::Location::Locations::Client)

#operations_client

def operations_client() -> ::Google::Cloud::Retail::V2::AnalyticsService::Operations

Get the associated client for long-running operations.

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)