Reference documentation and code samples for the Retail V2 API class Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.
REST 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::ConfigurationConfigure the AnalyticsService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all AnalyticsService clients ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#export_analytics_metrics
def export_analytics_metrics(request, options = nil) -> ::Gapic::Operation
def export_analytics_metrics(catalog: nil, output_config: nil, filter: nil) -> ::Gapic::OperationExports analytics metrics.
Operation.response is of type ExportAnalyticsMetricsResponse.
Operation.metadata is of type ExportMetadata.
def export_analytics_metrics(request, options = nil) -> ::Gapic::Operationexport_analytics_metrics via a request object, either of type
ExportAnalyticsMetricsRequest or an equivalent Hash.
- 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::Operationexport_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).
-
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. Thetimestamprestriction should result in one, contiguous, valid,timestamprange.
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"
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the REST call is aborted.
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::Rest::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| ... } -> ClientCreate a new AnalyticsService REST client object.
- (config) — Configure the AnalyticsService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.new do |config| config.timeout = 10.0 end
#location_client
def location_client() -> Google::Cloud::Location::Locations::Rest::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Rest::Client)
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#operations_client
def operations_client() -> ::Google::Cloud::Retail::V2::AnalyticsService::Rest::OperationsGet the associated client for long-running operations.
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (String)