1.0.0-beta25 (latest) 1.0.0-beta24

    public abstract class UserEventServiceClient

Reference documentation and code samples for the Discovery Engine v1beta API class UserEventServiceClient.

UserEventService client wrapper, for convenient use.

## Inheritance

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

## 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)

## Derived Types

[UserEventServiceClientImpl](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.UserEventServiceClientImpl)

## Namespace

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

## Assembly

Google.Cloud.DiscoveryEngine.V1Beta.dll

## Remarks

Service for ingesting end user actions on a website to Discovery Engine API.

## Properties

### DefaultEndpoint

    public static string DefaultEndpoint { get; }

The default endpoint for the UserEventService service, which is a host of "discoveryengine.googleapis.com"
and a port of 443.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### DefaultScopes

    public static IReadOnlyList<string> DefaultScopes { get; }

The default UserEventService scopes.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1https://learn.microsoft.com/dotnet/api/system.string` |   |

**Remarks** The default UserEventService scopes are:

- <https://www.googleapis.com/auth/cloud-platform>
- <https://www.googleapis.com/auth/discoveryengine.assist.readwrite>
- <https://www.googleapis.com/auth/discoveryengine.readwrite>
- <https://www.googleapis.com/auth/discoveryengine.serving.readwrite>

### GrpcClient

    public virtual UserEventService.UserEventServiceClient GrpcClient { get; }

The underlying gRPC UserEventService client

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.UserEventServicehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.UserEventService.UserEventServiceClient` |   |

### ImportUserEventsOperationsClient

    public virtual OperationsClient ImportUserEventsOperationsClient { get; }

The long-running operations client for `ImportUserEvents`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.OperationsClient.html` |   |

### LocationsClient

    public virtual LocationsClient LocationsClient { get; }

The [LocationsClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.LocationsClient.html) associated with this client.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.LocationsClient.html` |   |

### PurgeUserEventsOperationsClient

    public virtual OperationsClient PurgeUserEventsOperationsClient { get; }

The long-running operations client for `PurgeUserEvents`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.OperationsClient.html` |   |

### ServiceMetadata

    public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ServiceMetadata.html` |   |

## Methods

### CollectUserEvent(CollectUserEventRequest, CallSettings)

    public virtual HttpBody CollectUserEvent(CollectUserEventRequest request, CallSettings callSettings = null)

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

This method is used only by the Discovery Engine API JavaScript pixel and
Google Tag Manager. Users should not call this method directly.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.CollectUserEventRequest` 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.CommonProtos/latest/Google.Api.HttpBody.html` | The RPC response. |

**Example**

    // Create client
    UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create();
    // Initialize request argument(s)
    CollectUserEventRequest request = new CollectUserEventRequest
    {
        ParentAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
        UserEvent = "",
        Uri = "",
        Ets = 0L,
    };
    // Make the request
    HttpBody response = userEventServiceClient.CollectUserEvent(request);

### CollectUserEventAsync(CollectUserEventRequest, CallSettings)

    public virtual Task<HttpBody> CollectUserEventAsync(CollectUserEventRequest request, CallSettings callSettings = null)

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

This method is used only by the Discovery Engine API JavaScript pixel and
Google Tag Manager. Users should not call this method directly.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.CollectUserEventRequest` 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://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.HttpBody.html` | A Task containing the RPC response. |

**Example**

    // Create client
    UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
    // Initialize request argument(s)
    CollectUserEventRequest request = new CollectUserEventRequest
    {
        ParentAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
        UserEvent = "",
        Uri = "",
        Ets = 0L,
    };
    // Make the request
    HttpBody response = await userEventServiceClient.CollectUserEventAsync(request);

### CollectUserEventAsync(CollectUserEventRequest, CancellationToken)

    public virtual Task<HttpBody> CollectUserEventAsync(CollectUserEventRequest request, CancellationToken cancellationToken)

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

This method is used only by the Discovery Engine API JavaScript pixel and
Google Tag Manager. Users should not call this method directly.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.CollectUserEventRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **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` | A Task containing the RPC response. |

**Example**

    // Create client
    UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
    // Initialize request argument(s)
    CollectUserEventRequest request = new CollectUserEventRequest
    {
        ParentAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
        UserEvent = "",
        Uri = "",
        Ets = 0L,
    };
    // Make the request
    HttpBody response = await userEventServiceClient.CollectUserEventAsync(request);

### Create()

    public static UserEventServiceClient Create()

Synchronously creates a [UserEventServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.UserEventServiceClient) using the default credentials, endpoint and
settings. To specify custom credentials or other settings, use [UserEventServiceClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.UserEventServiceClientBuilder).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.UserEventServiceClient` | The created [UserEventServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.UserEventServiceClient). |

### CreateAsync(CancellationToken)

    public static Task<UserEventServiceClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a [UserEventServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.UserEventServiceClient) using the default credentials, endpoint and
settings. To specify custom credentials or other settings, use [UserEventServiceClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.UserEventServiceClientBuilder).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` The [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use while creating the client. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.UserEventServiceClient` | The task representing the created [UserEventServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.UserEventServiceClient). |

### ImportUserEvents(ImportUserEventsRequest, CallSettings)

    public virtual Operation<ImportUserEventsResponse, ImportUserEventsMetadata> ImportUserEvents(ImportUserEventsRequest request, CallSettings callSettings = null)

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.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.ImportUserEventsRequest` 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://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.ImportUserEventsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.ImportUserEventsMetadata` | The RPC response. |

**Example**

    // Create client
    UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create();
    // Initialize request argument(s)
    ImportUserEventsRequest request = new ImportUserEventsRequest
    {
        ParentAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
        InlineSource = new ImportUserEventsRequest.Types.InlineSource(),
        ErrorConfig = new ImportErrorConfig(),
    };
    // Make the request
    Operation<ImportUserEventsResponse, ImportUserEventsMetadata> response = userEventServiceClient.ImportUserEvents(request);

    // Poll until the returned long-running operation is complete
    Operation<ImportUserEventsResponse, ImportUserEventsMetadata> completedResponse = response.PollUntilCompleted();
    // Retrieve the operation result
    ImportUserEventsResponse result = completedResponse.Result;

    // Or get the name of the operation
    string operationName = response.Name;
    // This name can be stored, then the long-running operation retrieved later by name
    Operation<ImportUserEventsResponse, ImportUserEventsMetadata> retrievedResponse = userEventServiceClient.PollOnceImportUserEvents(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        ImportUserEventsResponse retrievedResult = retrievedResponse.Result;
    }

### ImportUserEventsAsync(ImportUserEventsRequest, CallSettings)

    public virtual Task<Operation<ImportUserEventsResponse, ImportUserEventsMetadata>> ImportUserEventsAsync(ImportUserEventsRequest request, CallSettings callSettings = null)

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.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.ImportUserEventsRequest` 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://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.ImportUserEventsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.ImportUserEventsMetadata` | A Task containing the RPC response. |

**Example**

    // Create client
    UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
    // Initialize request argument(s)
    ImportUserEventsRequest request = new ImportUserEventsRequest
    {
        ParentAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
        InlineSource = new ImportUserEventsRequest.Types.InlineSource(),
        ErrorConfig = new ImportErrorConfig(),
    };
    // Make the request
    Operation<ImportUserEventsResponse, ImportUserEventsMetadata> response = await userEventServiceClient.ImportUserEventsAsync(request);

    // Poll until the returned long-running operation is complete
    Operation<ImportUserEventsResponse, ImportUserEventsMetadata> completedResponse = await response.PollUntilCompletedAsync();
    // Retrieve the operation result
    ImportUserEventsResponse result = completedResponse.Result;

    // Or get the name of the operation
    string operationName = response.Name;
    // This name can be stored, then the long-running operation retrieved later by name
    Operation<ImportUserEventsResponse, ImportUserEventsMetadata> retrievedResponse = await userEventServiceClient.PollOnceImportUserEventsAsync(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        ImportUserEventsResponse retrievedResult = retrievedResponse.Result;
    }

### ImportUserEventsAsync(ImportUserEventsRequest, CancellationToken)

    public virtual Task<Operation<ImportUserEventsResponse, ImportUserEventsMetadata>> ImportUserEventsAsync(ImportUserEventsRequest request, CancellationToken cancellationToken)

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.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.ImportUserEventsRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **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-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.ImportUserEventsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.ImportUserEventsMetadata` | A Task containing the RPC response. |

**Example**

    // Create client
    UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
    // Initialize request argument(s)
    ImportUserEventsRequest request = new ImportUserEventsRequest
    {
        ParentAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
        InlineSource = new ImportUserEventsRequest.Types.InlineSource(),
        ErrorConfig = new ImportErrorConfig(),
    };
    // Make the request
    Operation<ImportUserEventsResponse, ImportUserEventsMetadata> response = await userEventServiceClient.ImportUserEventsAsync(request);

    // Poll until the returned long-running operation is complete
    Operation<ImportUserEventsResponse, ImportUserEventsMetadata> completedResponse = await response.PollUntilCompletedAsync();
    // Retrieve the operation result
    ImportUserEventsResponse result = completedResponse.Result;

    // Or get the name of the operation
    string operationName = response.Name;
    // This name can be stored, then the long-running operation retrieved later by name
    Operation<ImportUserEventsResponse, ImportUserEventsMetadata> retrievedResponse = await userEventServiceClient.PollOnceImportUserEventsAsync(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        ImportUserEventsResponse retrievedResult = retrievedResponse.Result;
    }

### PollOnceImportUserEvents(string, CallSettings)

    public virtual Operation<ImportUserEventsResponse, ImportUserEventsMetadata> PollOnceImportUserEvents(string operationName, CallSettings callSettings = null)

Poll an operation once, using an `operationName` from a previous invocation of `ImportUserEvents`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `operationName` | `https://learn.microsoft.com/dotnet/api/system.string` The name of a previously invoked operation. Must not be `null` or empty. |
| `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://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.ImportUserEventsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.ImportUserEventsMetadata` | The result of polling the operation. |

### PollOnceImportUserEventsAsync(string, CallSettings)

    public virtual Task<Operation<ImportUserEventsResponse, ImportUserEventsMetadata>> PollOnceImportUserEventsAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an `operationName` from a previous invocation of
`ImportUserEvents`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `operationName` | `https://learn.microsoft.com/dotnet/api/system.string` The name of a previously invoked operation. Must not be `null` or empty. |
| `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://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.ImportUserEventsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.ImportUserEventsMetadata` | A task representing the result of polling the operation. |

### PollOncePurgeUserEvents(string, CallSettings)

    public virtual Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata> PollOncePurgeUserEvents(string operationName, CallSettings callSettings = null)

Poll an operation once, using an `operationName` from a previous invocation of `PurgeUserEvents`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `operationName` | `https://learn.microsoft.com/dotnet/api/system.string` The name of a previously invoked operation. Must not be `null` or empty. |
| `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://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.PurgeUserEventsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.PurgeUserEventsMetadata` | The result of polling the operation. |

### PollOncePurgeUserEventsAsync(string, CallSettings)

    public virtual Task<Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata>> PollOncePurgeUserEventsAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an `operationName` from a previous invocation of
`PurgeUserEvents`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `operationName` | `https://learn.microsoft.com/dotnet/api/system.string` The name of a previously invoked operation. Must not be `null` or empty. |
| `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://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.PurgeUserEventsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.PurgeUserEventsMetadata` | A task representing the result of polling the operation. |

### PurgeUserEvents(PurgeUserEventsRequest, CallSettings)

    public virtual Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata> PurgeUserEvents(PurgeUserEventsRequest request, CallSettings callSettings = null)

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.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.PurgeUserEventsRequest` 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://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.PurgeUserEventsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.PurgeUserEventsMetadata` | The RPC response. |

**Example**

    // Create client
    UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create();
    // Initialize request argument(s)
    PurgeUserEventsRequest request = new PurgeUserEventsRequest
    {
        ParentAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
        Filter = "",
        Force = false,
    };
    // Make the request
    Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata> response = userEventServiceClient.PurgeUserEvents(request);

    // Poll until the returned long-running operation is complete
    Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata> completedResponse = response.PollUntilCompleted();
    // Retrieve the operation result
    PurgeUserEventsResponse result = completedResponse.Result;

    // Or get the name of the operation
    string operationName = response.Name;
    // This name can be stored, then the long-running operation retrieved later by name
    Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata> retrievedResponse = userEventServiceClient.PollOncePurgeUserEvents(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        PurgeUserEventsResponse retrievedResult = retrievedResponse.Result;
    }

### PurgeUserEventsAsync(PurgeUserEventsRequest, CallSettings)

    public virtual Task<Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata>> PurgeUserEventsAsync(PurgeUserEventsRequest request, CallSettings callSettings = null)

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.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.PurgeUserEventsRequest` 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://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.PurgeUserEventsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.PurgeUserEventsMetadata` | A Task containing the RPC response. |

**Example**

    // Create client
    UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
    // Initialize request argument(s)
    PurgeUserEventsRequest request = new PurgeUserEventsRequest
    {
        ParentAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
        Filter = "",
        Force = false,
    };
    // Make the request
    Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata> response = await userEventServiceClient.PurgeUserEventsAsync(request);

    // Poll until the returned long-running operation is complete
    Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata> completedResponse = await response.PollUntilCompletedAsync();
    // Retrieve the operation result
    PurgeUserEventsResponse result = completedResponse.Result;

    // Or get the name of the operation
    string operationName = response.Name;
    // This name can be stored, then the long-running operation retrieved later by name
    Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata> retrievedResponse = await userEventServiceClient.PollOncePurgeUserEventsAsync(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        PurgeUserEventsResponse retrievedResult = retrievedResponse.Result;
    }

### PurgeUserEventsAsync(PurgeUserEventsRequest, CancellationToken)

    public virtual Task<Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata>> PurgeUserEventsAsync(PurgeUserEventsRequest request, CancellationToken cancellationToken)

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.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.PurgeUserEventsRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **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-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.PurgeUserEventsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.PurgeUserEventsMetadata` | A Task containing the RPC response. |

**Example**

    // Create client
    UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
    // Initialize request argument(s)
    PurgeUserEventsRequest request = new PurgeUserEventsRequest
    {
        ParentAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
        Filter = "",
        Force = false,
    };
    // Make the request
    Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata> response = await userEventServiceClient.PurgeUserEventsAsync(request);

    // Poll until the returned long-running operation is complete
    Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata> completedResponse = await response.PollUntilCompletedAsync();
    // Retrieve the operation result
    PurgeUserEventsResponse result = completedResponse.Result;

    // Or get the name of the operation
    string operationName = response.Name;
    // This name can be stored, then the long-running operation retrieved later by name
    Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata> retrievedResponse = await userEventServiceClient.PollOncePurgeUserEventsAsync(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        PurgeUserEventsResponse retrievedResult = retrievedResponse.Result;
    }

### ShutdownDefaultChannelsAsync()

    public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by [Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.UserEventServiceClient#Google_Cloud_DiscoveryEngine_V1Beta_UserEventServiceClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.UserEventServiceClient#Google_Cloud_DiscoveryEngine_V1Beta_UserEventServiceClient_CreateAsync_System_Threading_CancellationToken_). Channels which weren't automatically created are not
affected.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` | A task representing the asynchronous shutdown operation. |

**Remarks** After calling this method, further calls to [Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.UserEventServiceClient#Google_Cloud_DiscoveryEngine_V1Beta_UserEventServiceClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.UserEventServiceClient#Google_Cloud_DiscoveryEngine_V1Beta_UserEventServiceClient_CreateAsync_System_Threading_CancellationToken_) will create new channels, which could in turn be shut down
by another call to this method.

### WriteUserEvent(WriteUserEventRequest, CallSettings)

    public virtual UserEvent WriteUserEvent(WriteUserEventRequest request, CallSettings callSettings = null)

Writes a single user event.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.WriteUserEventRequest` 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://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.UserEvent` | The RPC response. |

**Example**

    // Create client
    UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create();
    // Initialize request argument(s)
    WriteUserEventRequest request = new WriteUserEventRequest
    {
        ParentAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
        UserEvent = new UserEvent(),
        WriteAsync = false,
    };
    // Make the request
    UserEvent response = userEventServiceClient.WriteUserEvent(request);

### WriteUserEventAsync(WriteUserEventRequest, CallSettings)

    public virtual Task<UserEvent> WriteUserEventAsync(WriteUserEventRequest request, CallSettings callSettings = null)

Writes a single user event.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.WriteUserEventRequest` 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://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.UserEvent` | A Task containing the RPC response. |

**Example**

    // Create client
    UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
    // Initialize request argument(s)
    WriteUserEventRequest request = new WriteUserEventRequest
    {
        ParentAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
        UserEvent = new UserEvent(),
        WriteAsync = false,
    };
    // Make the request
    UserEvent response = await userEventServiceClient.WriteUserEventAsync(request);

### WriteUserEventAsync(WriteUserEventRequest, CancellationToken)

    public virtual Task<UserEvent> WriteUserEventAsync(WriteUserEventRequest request, CancellationToken cancellationToken)

Writes a single user event.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.WriteUserEventRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.UserEvent` | A Task containing the RPC response. |

**Example**

    // Create client
    UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
    // Initialize request argument(s)
    WriteUserEventRequest request = new WriteUserEventRequest
    {
        ParentAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
        UserEvent = new UserEvent(),
        WriteAsync = false,
    };
    // Make the request
    UserEvent response = await userEventServiceClient.WriteUserEventAsync(request);