Struct RecommendationService (0.5.0)

Implements a client for the Discovery Engine API.

Example

# tokio_test::block_on(async {
# use google_cloud_discoveryengine_v1::client::RecommendationService;
let client = RecommendationService::builder().build().await?;
// use `client` to make requests to the Discovery Engine API.
# gax::client_builder::Result::<()>::Ok(()) });

Service Description

Service for making recommendations.

Configuration

To configure RecommendationService use the with_* methods in the type returned by [builder()][RecommendationService::builder]. The default configuration should work for most applications. Common configuration changes include

  • with_endpoint(): by default this client uses the global default endpoint (https://discoveryengine.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default.
  • with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.

Pooling and Cloning

RecommendationService holds a connection pool internally, it is advised to create one and the reuse it. You do not need to wrap RecommendationService in an Rc or Arc to reuse it, because it already uses an Arc internally.

Implementations

builder

 fn builder() -> super::builder::recommendation_service::ClientBuilder

Returns a builder for [RecommendationService].

# tokio_test::block_on(async {
# use google_cloud_discoveryengine_v1::client::RecommendationService;
let client = RecommendationService::builder().build().await?;
# gax::client_builder::Result::<()>::Ok(()) });

from_stub

 fn from_stub<T>(stub: T) -> Self
where
    T: super::stub::RecommendationService + 'static,

Creates a new client from the provided stub.

The most common case for calling this function is in tests mocking the client's behavior.

recommend

 fn recommend(self: &Self) -> super::builder::recommendation_service::Recommend

Makes a recommendation, which requires a contextual user event.

list_operations

 fn list_operations(self: &Self) -> super::builder::recommendation_service::ListOperations

Provides the Operations service functionality in this service.

get_operation

 fn get_operation(self: &Self) -> super::builder::recommendation_service::GetOperation

Provides the Operations service functionality in this service.

cancel_operation

 fn cancel_operation(self: &Self) -> super::builder::recommendation_service::CancelOperation

Provides the Operations service functionality in this service.