# Recommendations AI v1beta1 API - Class PredictionServiceClientImpl (2.0.0-beta07)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.0.0-beta07 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictionServiceClientImpl)
- [2.0.0-beta06](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/2.0.0-beta06/Google.Cloud.RecommendationEngine.V1Beta1.PredictionServiceClientImpl)
- [1.0.0-beta03](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/1.0.0-beta03/Google.Cloud.RecommendationEngine.V1Beta1.PredictionServiceClientImpl)

    public sealed class PredictionServiceClientImpl : PredictionServiceClient

Reference documentation and code samples for the Recommendations AI v1beta1 API class PredictionServiceClientImpl.

PredictionService client wrapper implementation, for convenient use.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> [PredictionServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictionServiceClient) \> PredictionServiceClientImpl

## Inherited Members

[PredictionServiceClient.DefaultEndpoint](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictionServiceClient#Google_Cloud_RecommendationEngine_V1Beta1_PredictionServiceClient_DefaultEndpoint) [PredictionServiceClient.DefaultScopes](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictionServiceClient#Google_Cloud_RecommendationEngine_V1Beta1_PredictionServiceClient_DefaultScopes) [PredictionServiceClient.ServiceMetadata](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictionServiceClient#Google_Cloud_RecommendationEngine_V1Beta1_PredictionServiceClient_ServiceMetadata) [PredictionServiceClient.CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictionServiceClient#Google_Cloud_RecommendationEngine_V1Beta1_PredictionServiceClient_CreateAsync_System_Threading_CancellationToken_) [PredictionServiceClient.Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictionServiceClient#Google_Cloud_RecommendationEngine_V1Beta1_PredictionServiceClient_Create) [PredictionServiceClient.ShutdownDefaultChannelsAsync()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictionServiceClient#Google_Cloud_RecommendationEngine_V1Beta1_PredictionServiceClient_ShutdownDefaultChannelsAsync) [PredictionServiceClient.Predict(string, UserEvent, string, int?, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictionServiceClient#Google_Cloud_RecommendationEngine_V1Beta1_PredictionServiceClient_Predict_System_String_Google_Cloud_RecommendationEngine_V1Beta1_UserEvent_System_String_System_Nullable_System_Int32__Google_Api_Gax_Grpc_CallSettings_) [PredictionServiceClient.PredictAsync(string, UserEvent, string, int?, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictionServiceClient#Google_Cloud_RecommendationEngine_V1Beta1_PredictionServiceClient_PredictAsync_System_String_Google_Cloud_RecommendationEngine_V1Beta1_UserEvent_System_String_System_Nullable_System_Int32__Google_Api_Gax_Grpc_CallSettings_) [PredictionServiceClient.Predict(PlacementName, UserEvent, string, int?, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictionServiceClient#Google_Cloud_RecommendationEngine_V1Beta1_PredictionServiceClient_Predict_Google_Cloud_RecommendationEngine_V1Beta1_PlacementName_Google_Cloud_RecommendationEngine_V1Beta1_UserEvent_System_String_System_Nullable_System_Int32__Google_Api_Gax_Grpc_CallSettings_) [PredictionServiceClient.PredictAsync(PlacementName, UserEvent, string, int?, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictionServiceClient#Google_Cloud_RecommendationEngine_V1Beta1_PredictionServiceClient_PredictAsync_Google_Cloud_RecommendationEngine_V1Beta1_PlacementName_Google_Cloud_RecommendationEngine_V1Beta1_UserEvent_System_String_System_Nullable_System_Int32__Google_Api_Gax_Grpc_CallSettings_) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.RecommendationEngine.V1Beta1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1)

## Assembly

Google.Cloud.RecommendationEngine.V1Beta1.dll

## Remarks

Service for making recommendation prediction.

## Constructors

### PredictionServiceClientImpl(PredictionServiceClient, PredictionServiceSettings, ILogger)

    public PredictionServiceClientImpl(PredictionService.PredictionServiceClient grpcClient, PredictionServiceSettings settings, ILogger logger)

Constructs a client wrapper for the PredictionService service, with the specified gRPC client and settings.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `grpcClient` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictionServicehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictionService.PredictionServiceClient` The underlying gRPC client. |
| `settings` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictionServiceSettings` The base [PredictionServiceSettings](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictionServiceSettings) used within this client. |
| `logger` | `https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger` Optional [ILogger](https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger) to use within this client. |

## Properties

### GrpcClient

    public override PredictionService.PredictionServiceClient GrpcClient { get; }

The underlying gRPC PredictionService client

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictionServicehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictionService.PredictionServiceClient` |   |

**Overrides** [PredictionServiceClient.GrpcClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictionServiceClient#Google_Cloud_RecommendationEngine_V1Beta1_PredictionServiceClient_GrpcClient)

## Methods

### Predict(PredictRequest, CallSettings)

    public override PagedEnumerable<PredictResponse, PredictResponse.Types.PredictionResult> Predict(PredictRequest request, CallSettings callSettings = null)

Makes a recommendation prediction. If using API Key based authentication,
the API Key must be registered using the
\[PredictionApiKeyRegistry\]\[google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry\]
service. [Learn more](https://docs.cloud.google.com/recommendations-ai/docs/setting-up#register-key).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictResponse.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictResponse.Types.PredictionResult` | A pageable sequence of [PredictResponse.Types.PredictionResult](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictResponse.Types.PredictionResult) resources. |

**Overrides** [PredictionServiceClient.Predict(PredictRequest, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictionServiceClient#Google_Cloud_RecommendationEngine_V1Beta1_PredictionServiceClient_Predict_Google_Cloud_RecommendationEngine_V1Beta1_PredictRequest_Google_Api_Gax_Grpc_CallSettings_)

### PredictAsync(PredictRequest, CallSettings)

    public override PagedAsyncEnumerable<PredictResponse, PredictResponse.Types.PredictionResult> PredictAsync(PredictRequest request, CallSettings callSettings = null)

Makes a recommendation prediction. If using API Key based authentication,
the API Key must be registered using the
\[PredictionApiKeyRegistry\]\[google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry\]
service. [Learn more](https://docs.cloud.google.com/recommendations-ai/docs/setting-up#register-key).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedAsyncEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictResponse.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictResponse.Types.PredictionResult` | A pageable asynchronous sequence of [PredictResponse.Types.PredictionResult](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictResponse.Types.PredictionResult) resources. |

**Overrides** [PredictionServiceClient.PredictAsync(PredictRequest, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PredictionServiceClient#Google_Cloud_RecommendationEngine_V1Beta1_PredictionServiceClient_PredictAsync_Google_Cloud_RecommendationEngine_V1Beta1_PredictRequest_Google_Api_Gax_Grpc_CallSettings_)