구조체 RecommendationService(0.5.0)

Discovery Engine API의 클라이언트를 구현합니다.

예

# 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(()) });

서비스 설명

추천을 제공하는 서비스입니다.

구성

RecommendationService를 구성하려면 [builder()][RecommendationService::builder]에서 반환하는 유형의 with_* 메서드를 사용합니다. 대부분의 애플리케이션에서는 기본 구성이 작동합니다. 일반적인 구성 변경사항은 다음과 같습니다.

  • with_endpoint(): 기본적으로 이 클라이언트는 전역 기본 엔드포인트(https://discoveryengine.googleapis.com)를 사용합니다. 리전 엔드포인트를 사용하거나 제한된 네트워크(예: 구성된 네트워크)에서 실행되는 애플리케이션은 이 기본값을 재정의합니다.
  • with_credentials(): 기본적으로 이 클라이언트는 애플리케이션 기본 사용자 인증 정보를 사용합니다. 커스텀 인증을 사용하는 애플리케이션은 이 기본값을 재정의해야 할 수 있습니다.

풀링 및 클론

RecommendationService는 내부적으로 연결 풀을 보유하므로 하나를 만들고 재사용하는 것이 좋습니다. RecommendationService는 이미 내부적으로 Arc를 사용하므로 재사용하기 위해 Rc 또는 Arc로 래핑할 필요가 없습니다.

구현

빌더

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

[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,

제공된 스텁에서 새 클라이언트를 만듭니다.

이 함수를 호출하는 가장 일반적인 경우는 클라이언트의 동작을 모의하는 테스트입니다.

recommend

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

상황별 사용자 이벤트가 필요한 추천을 만듭니다.

list_operations

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

이 서비스에서 작업 서비스 기능을 제공합니다.

get_operation

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

이 서비스에서 작업 서비스 기능을 제공합니다.

cancel_operation

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

이 서비스에서 작업 서비스 기능을 제공합니다.