# Recommendations AI v1beta1 API - Class UserEventService.UserEventServiceBase (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.UserEventService.UserEventServiceBase)
- [2.0.0-beta06](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/2.0.0-beta06/Google.Cloud.RecommendationEngine.V1Beta1.UserEventService.UserEventServiceBase)
- [1.0.0-beta03](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/1.0.0-beta03/Google.Cloud.RecommendationEngine.V1Beta1.UserEventService.UserEventServiceBase)

    [BindServiceMethod(typeof(UserEventService), "BindService")]
    public abstract class UserEventService.UserEventServiceBase

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

Base class for server-side implementations of UserEventService

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> UserEventService.UserEventServiceBase

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [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

## Methods

### CollectUserEvent(CollectUserEventRequest, ServerCallContext)

    public virtual Task<HttpBody> CollectUserEvent(CollectUserEventRequest request, ServerCallContext context)

Writes a single user event from the browser. This uses a GET request to
due to browser restriction of POST-ing to a 3rd party domain.

This method is used only by the Recommendations AI JavaScript pixel.
Users should not call this method directly.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.CollectUserEventRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.HttpBody.html` | The response to send back to the client (wrapped by a task). |

### ImportUserEvents(ImportUserEventsRequest, ServerCallContext)

    public virtual Task<Operation> ImportUserEvents(ImportUserEventsRequest request, ServerCallContext context)

Bulk import of User events. Request processing might be
synchronous. Events that already exist are skipped.
Use this method for backfilling historical user events.

Operation.response is of type ImportResponse. Note that it is
possible for a subset of the items to be successfully inserted.
Operation.metadata is of type ImportMetadata.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.ImportUserEventsRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation.html` | The response to send back to the client (wrapped by a task). |

### ListUserEvents(ListUserEventsRequest, ServerCallContext)

    public virtual Task<ListUserEventsResponse> ListUserEvents(ListUserEventsRequest request, ServerCallContext context)

Gets a list of user events within a time range, with potential filtering.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.ListUserEventsRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.ListUserEventsResponse` | The response to send back to the client (wrapped by a task). |

### PurgeUserEvents(PurgeUserEventsRequest, ServerCallContext)

    public virtual Task<Operation> PurgeUserEvents(PurgeUserEventsRequest request, ServerCallContext context)

Deletes permanently all user events specified by the filter provided.
Depending on the number of events specified by the filter, this operation
could take hours or days to complete. To test a filter, use the list
command first.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.PurgeUserEventsRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation.html` | The response to send back to the client (wrapped by a task). |

### WriteUserEvent(WriteUserEventRequest, ServerCallContext)

    public virtual Task<UserEvent> WriteUserEvent(WriteUserEventRequest request, ServerCallContext context)

Writes a single user event.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.WriteUserEventRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.UserEvent` | The response to send back to the client (wrapped by a task). |