Recommendations AI v1beta1 API - Class UserEventServiceClient (2.0.0-beta05)

public abstract class UserEventServiceClient

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

UserEventService client wrapper, for convenient use.

Inheritance

object > UserEventServiceClient

Namespace

Google.Cloud.RecommendationEngine.V1Beta1

Assembly

Google.Cloud.RecommendationEngine.V1Beta1.dll

Remarks

Service for ingesting end user actions on the customer website.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default UserEventService scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default UserEventService scopes are:

GrpcClient

public virtual UserEventService.UserEventServiceClient GrpcClient { get; }

The underlying gRPC UserEventService client

Property Value
Type Description
UserEventServiceUserEventServiceClient

ImportUserEventsOperationsClient

public virtual OperationsClient ImportUserEventsOperationsClient { get; }

The long-running operations client for ImportUserEvents.

Property Value
Type Description
OperationsClient

PurgeUserEventsOperationsClient

public virtual OperationsClient PurgeUserEventsOperationsClient { get; }

The long-running operations client for PurgeUserEvents.

Property Value
Type Description
OperationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

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 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 CollectUserEventRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
HttpBody

The RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create();
// Initialize request argument(s)
CollectUserEventRequest request = new CollectUserEventRequest
{
    ParentAsEventStoreName = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"),
    UserEvent = "",
    Uri = "",
    Ets = 0L,
};
// Make the request
HttpBody response = userEventServiceClient.CollectUserEvent(request);

CollectUserEvent(EventStoreName, string, string, long, CallSettings)

public virtual HttpBody CollectUserEvent(EventStoreName parent, string userEvent, string uri, long ets, 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 3rd party domain.

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

Parameters
Name Description
parent EventStoreName

Required. The parent eventStore name, such as projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store.

userEvent string

Required. URL encoded UserEvent proto.

uri string

Optional. The url including cgi-parameters but excluding the hash fragment. The URL must be truncated to 1.5K bytes to conservatively be under the 2K bytes. This is often more useful than the referer url, because many browsers only send the domain for 3rd party requests.

ets long

Optional. The event timestamp in milliseconds. This prevents browser caching of otherwise identical get requests. The name is abbreviated to reduce the payload bytes.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
HttpBody

The RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create();
// Initialize request argument(s)
EventStoreName parent = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
string userEvent = "";
string uri = "";
long ets = 0L;
// Make the request
HttpBody response = userEventServiceClient.CollectUserEvent(parent, userEvent, uri, ets);

CollectUserEvent(string, string, string, long, CallSettings)

public virtual HttpBody CollectUserEvent(string parent, string userEvent, string uri, long ets, 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 3rd party domain.

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

Parameters
Name Description
parent string

Required. The parent eventStore name, such as projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store.

userEvent string

Required. URL encoded UserEvent proto.

uri string

Optional. The url including cgi-parameters but excluding the hash fragment. The URL must be truncated to 1.5K bytes to conservatively be under the 2K bytes. This is often more useful than the referer url, because many browsers only send the domain for 3rd party requests.

ets long

Optional. The event timestamp in milliseconds. This prevents browser caching of otherwise identical get requests. The name is abbreviated to reduce the payload bytes.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
HttpBody

The RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/eventStores/[EVENT_STORE]";
string userEvent = "";
string uri = "";
long ets = 0L;
// Make the request
HttpBody response = userEventServiceClient.CollectUserEvent(parent, userEvent, uri, ets);

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 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 CollectUserEventRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskHttpBody

A Task containing the RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
CollectUserEventRequest request = new CollectUserEventRequest
{
    ParentAsEventStoreName = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_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 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 CollectUserEventRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskHttpBody

A Task containing the RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
CollectUserEventRequest request = new CollectUserEventRequest
{
    ParentAsEventStoreName = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"),
    UserEvent = "",
    Uri = "",
    Ets = 0L,
};
// Make the request
HttpBody response = await userEventServiceClient.CollectUserEventAsync(request);

CollectUserEventAsync(EventStoreName, string, string, long, CallSettings)

public virtual Task<HttpBody> CollectUserEventAsync(EventStoreName parent, string userEvent, string uri, long ets, 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 3rd party domain.

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

Parameters
Name Description
parent EventStoreName

Required. The parent eventStore name, such as projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store.

userEvent string

Required. URL encoded UserEvent proto.

uri string

Optional. The url including cgi-parameters but excluding the hash fragment. The URL must be truncated to 1.5K bytes to conservatively be under the 2K bytes. This is often more useful than the referer url, because many browsers only send the domain for 3rd party requests.

ets long

Optional. The event timestamp in milliseconds. This prevents browser caching of otherwise identical get requests. The name is abbreviated to reduce the payload bytes.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskHttpBody

A Task containing the RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
EventStoreName parent = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
string userEvent = "";
string uri = "";
long ets = 0L;
// Make the request
HttpBody response = await userEventServiceClient.CollectUserEventAsync(parent, userEvent, uri, ets);

CollectUserEventAsync(EventStoreName, string, string, long, CancellationToken)

public virtual Task<HttpBody> CollectUserEventAsync(EventStoreName parent, string userEvent, string uri, long ets, 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 3rd party domain.

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

Parameters
Name Description
parent EventStoreName

Required. The parent eventStore name, such as projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store.

userEvent string

Required. URL encoded UserEvent proto.

uri string

Optional. The url including cgi-parameters but excluding the hash fragment. The URL must be truncated to 1.5K bytes to conservatively be under the 2K bytes. This is often more useful than the referer url, because many browsers only send the domain for 3rd party requests.

ets long

Optional. The event timestamp in milliseconds. This prevents browser caching of otherwise identical get requests. The name is abbreviated to reduce the payload bytes.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskHttpBody

A Task containing the RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
EventStoreName parent = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
string userEvent = "";
string uri = "";
long ets = 0L;
// Make the request
HttpBody response = await userEventServiceClient.CollectUserEventAsync(parent, userEvent, uri, ets);

CollectUserEventAsync(string, string, string, long, CallSettings)

public virtual Task<HttpBody> CollectUserEventAsync(string parent, string userEvent, string uri, long ets, 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 3rd party domain.

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

Parameters
Name Description
parent string

Required. The parent eventStore name, such as projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store.

userEvent string

Required. URL encoded UserEvent proto.

uri string

Optional. The url including cgi-parameters but excluding the hash fragment. The URL must be truncated to 1.5K bytes to conservatively be under the 2K bytes. This is often more useful than the referer url, because many browsers only send the domain for 3rd party requests.

ets long

Optional. The event timestamp in milliseconds. This prevents browser caching of otherwise identical get requests. The name is abbreviated to reduce the payload bytes.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskHttpBody

A Task containing the RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/eventStores/[EVENT_STORE]";
string userEvent = "";
string uri = "";
long ets = 0L;
// Make the request
HttpBody response = await userEventServiceClient.CollectUserEventAsync(parent, userEvent, uri, ets);

CollectUserEventAsync(string, string, string, long, CancellationToken)

public virtual Task<HttpBody> CollectUserEventAsync(string parent, string userEvent, string uri, long ets, 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 3rd party domain.

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

Parameters
Name Description
parent string

Required. The parent eventStore name, such as projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store.

userEvent string

Required. URL encoded UserEvent proto.

uri string

Optional. The url including cgi-parameters but excluding the hash fragment. The URL must be truncated to 1.5K bytes to conservatively be under the 2K bytes. This is often more useful than the referer url, because many browsers only send the domain for 3rd party requests.

ets long

Optional. The event timestamp in milliseconds. This prevents browser caching of otherwise identical get requests. The name is abbreviated to reduce the payload bytes.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskHttpBody

A Task containing the RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/eventStores/[EVENT_STORE]";
string userEvent = "";
string uri = "";
long ets = 0L;
// Make the request
HttpBody response = await userEventServiceClient.CollectUserEventAsync(parent, userEvent, uri, ets);

Create()

public static UserEventServiceClient Create()

Synchronously creates a UserEventServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use UserEventServiceClientBuilder.

Returns
Type Description
UserEventServiceClient

The created UserEventServiceClient.

CreateAsync(CancellationToken)

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

Asynchronously creates a UserEventServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use UserEventServiceClientBuilder.

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskUserEventServiceClient

The task representing the created UserEventServiceClient.

ImportUserEvents(EventStoreName, string, InputConfig, ImportErrorsConfig, CallSettings)

public virtual Operation<ImportUserEventsResponse, ImportMetadata> ImportUserEvents(EventStoreName parent, string requestId, InputConfig inputConfig, ImportErrorsConfig errorsConfig, 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
parent EventStoreName

Required. projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store

requestId string

Optional. Unique identifier provided by client, within the ancestor dataset scope. Ensures idempotency for expensive long running operations. Server-generated if unspecified. Up to 128 characters long. This is returned as google.longrunning.Operation.name in the response. Note that this field must not be set if the desired input config is catalog_inline_source.

inputConfig InputConfig

Required. The desired input location of the data.

errorsConfig ImportErrorsConfig

Optional. The desired location of errors incurred during the Import.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationImportUserEventsResponseImportMetadata

The RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create();
// Initialize request argument(s)
EventStoreName parent = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
string requestId = "";
InputConfig inputConfig = new InputConfig();
ImportErrorsConfig errorsConfig = new ImportErrorsConfig();
// Make the request
Operation<ImportUserEventsResponse, ImportMetadata> response = userEventServiceClient.ImportUserEvents(parent, requestId, inputConfig, errorsConfig);

// Poll until the returned long-running operation is complete
Operation<ImportUserEventsResponse, ImportMetadata> 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, ImportMetadata> 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;
}

ImportUserEvents(ImportUserEventsRequest, CallSettings)

public virtual Operation<ImportUserEventsResponse, ImportMetadata> 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 ImportUserEventsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationImportUserEventsResponseImportMetadata

The RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create();
// Initialize request argument(s)
ImportUserEventsRequest request = new ImportUserEventsRequest
{
    ParentAsEventStoreName = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"),
    RequestId = "",
    InputConfig = new InputConfig(),
    ErrorsConfig = new ImportErrorsConfig(),
};
// Make the request
Operation<ImportUserEventsResponse, ImportMetadata> response = userEventServiceClient.ImportUserEvents(request);

// Poll until the returned long-running operation is complete
Operation<ImportUserEventsResponse, ImportMetadata> 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, ImportMetadata> 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;
}

ImportUserEvents(string, string, InputConfig, ImportErrorsConfig, CallSettings)

public virtual Operation<ImportUserEventsResponse, ImportMetadata> ImportUserEvents(string parent, string requestId, InputConfig inputConfig, ImportErrorsConfig errorsConfig, 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
parent string

Required. projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store

requestId string

Optional. Unique identifier provided by client, within the ancestor dataset scope. Ensures idempotency for expensive long running operations. Server-generated if unspecified. Up to 128 characters long. This is returned as google.longrunning.Operation.name in the response. Note that this field must not be set if the desired input config is catalog_inline_source.

inputConfig InputConfig

Required. The desired input location of the data.

errorsConfig ImportErrorsConfig

Optional. The desired location of errors incurred during the Import.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationImportUserEventsResponseImportMetadata

The RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/eventStores/[EVENT_STORE]";
string requestId = "";
InputConfig inputConfig = new InputConfig();
ImportErrorsConfig errorsConfig = new ImportErrorsConfig();
// Make the request
Operation<ImportUserEventsResponse, ImportMetadata> response = userEventServiceClient.ImportUserEvents(parent, requestId, inputConfig, errorsConfig);

// Poll until the returned long-running operation is complete
Operation<ImportUserEventsResponse, ImportMetadata> 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, ImportMetadata> 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(EventStoreName, string, InputConfig, ImportErrorsConfig, CallSettings)

public virtual Task<Operation<ImportUserEventsResponse, ImportMetadata>> ImportUserEventsAsync(EventStoreName parent, string requestId, InputConfig inputConfig, ImportErrorsConfig errorsConfig, 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
parent EventStoreName

Required. projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store

requestId string

Optional. Unique identifier provided by client, within the ancestor dataset scope. Ensures idempotency for expensive long running operations. Server-generated if unspecified. Up to 128 characters long. This is returned as google.longrunning.Operation.name in the response. Note that this field must not be set if the desired input config is catalog_inline_source.

inputConfig InputConfig

Required. The desired input location of the data.

errorsConfig ImportErrorsConfig

Optional. The desired location of errors incurred during the Import.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationImportUserEventsResponseImportMetadata

A Task containing the RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
EventStoreName parent = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
string requestId = "";
InputConfig inputConfig = new InputConfig();
ImportErrorsConfig errorsConfig = new ImportErrorsConfig();
// Make the request
Operation<ImportUserEventsResponse, ImportMetadata> response = await userEventServiceClient.ImportUserEventsAsync(parent, requestId, inputConfig, errorsConfig);

// Poll until the returned long-running operation is complete
Operation<ImportUserEventsResponse, ImportMetadata> 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, ImportMetadata> 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(EventStoreName, string, InputConfig, ImportErrorsConfig, CancellationToken)

public virtual Task<Operation<ImportUserEventsResponse, ImportMetadata>> ImportUserEventsAsync(EventStoreName parent, string requestId, InputConfig inputConfig, ImportErrorsConfig errorsConfig, 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
parent EventStoreName

Required. projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store

requestId string

Optional. Unique identifier provided by client, within the ancestor dataset scope. Ensures idempotency for expensive long running operations. Server-generated if unspecified. Up to 128 characters long. This is returned as google.longrunning.Operation.name in the response. Note that this field must not be set if the desired input config is catalog_inline_source.

inputConfig InputConfig

Required. The desired input location of the data.

errorsConfig ImportErrorsConfig

Optional. The desired location of errors incurred during the Import.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationImportUserEventsResponseImportMetadata

A Task containing the RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
EventStoreName parent = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
string requestId = "";
InputConfig inputConfig = new InputConfig();
ImportErrorsConfig errorsConfig = new ImportErrorsConfig();
// Make the request
Operation<ImportUserEventsResponse, ImportMetadata> response = await userEventServiceClient.ImportUserEventsAsync(parent, requestId, inputConfig, errorsConfig);

// Poll until the returned long-running operation is complete
Operation<ImportUserEventsResponse, ImportMetadata> 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, ImportMetadata> 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, CallSettings)

public virtual Task<Operation<ImportUserEventsResponse, ImportMetadata>> 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 ImportUserEventsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationImportUserEventsResponseImportMetadata

A Task containing the RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
ImportUserEventsRequest request = new ImportUserEventsRequest
{
    ParentAsEventStoreName = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"),
    RequestId = "",
    InputConfig = new InputConfig(),
    ErrorsConfig = new ImportErrorsConfig(),
};
// Make the request
Operation<ImportUserEventsResponse, ImportMetadata> response = await userEventServiceClient.ImportUserEventsAsync(request);

// Poll until the returned long-running operation is complete
Operation<ImportUserEventsResponse, ImportMetadata> 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, ImportMetadata> 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, ImportMetadata>> 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 ImportUserEventsRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationImportUserEventsResponseImportMetadata

A Task containing the RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
ImportUserEventsRequest request = new ImportUserEventsRequest
{
    ParentAsEventStoreName = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"),
    RequestId = "",
    InputConfig = new InputConfig(),
    ErrorsConfig = new ImportErrorsConfig(),
};
// Make the request
Operation<ImportUserEventsResponse, ImportMetadata> response = await userEventServiceClient.ImportUserEventsAsync(request);

// Poll until the returned long-running operation is complete
Operation<ImportUserEventsResponse, ImportMetadata> 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, ImportMetadata> 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(string, string, InputConfig, ImportErrorsConfig, CallSettings)

public virtual Task<Operation<ImportUserEventsResponse, ImportMetadata>> ImportUserEventsAsync(string parent, string requestId, InputConfig inputConfig, ImportErrorsConfig errorsConfig, 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
parent string

Required. projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store

requestId string

Optional. Unique identifier provided by client, within the ancestor dataset scope. Ensures idempotency for expensive long running operations. Server-generated if unspecified. Up to 128 characters long. This is returned as google.longrunning.Operation.name in the response. Note that this field must not be set if the desired input config is catalog_inline_source.

inputConfig InputConfig

Required. The desired input location of the data.

errorsConfig ImportErrorsConfig

Optional. The desired location of errors incurred during the Import.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationImportUserEventsResponseImportMetadata

A Task containing the RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/eventStores/[EVENT_STORE]";
string requestId = "";
InputConfig inputConfig = new InputConfig();
ImportErrorsConfig errorsConfig = new ImportErrorsConfig();
// Make the request
Operation<ImportUserEventsResponse, ImportMetadata> response = await userEventServiceClient.ImportUserEventsAsync(parent, requestId, inputConfig, errorsConfig);

// Poll until the returned long-running operation is complete
Operation<ImportUserEventsResponse, ImportMetadata> 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, ImportMetadata> 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(string, string, InputConfig, ImportErrorsConfig, CancellationToken)

public virtual Task<Operation<ImportUserEventsResponse, ImportMetadata>> ImportUserEventsAsync(string parent, string requestId, InputConfig inputConfig, ImportErrorsConfig errorsConfig, 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
parent string

Required. projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store

requestId string

Optional. Unique identifier provided by client, within the ancestor dataset scope. Ensures idempotency for expensive long running operations. Server-generated if unspecified. Up to 128 characters long. This is returned as google.longrunning.Operation.name in the response. Note that this field must not be set if the desired input config is catalog_inline_source.

inputConfig InputConfig

Required. The desired input location of the data.

errorsConfig ImportErrorsConfig

Optional. The desired location of errors incurred during the Import.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationImportUserEventsResponseImportMetadata

A Task containing the RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/eventStores/[EVENT_STORE]";
string requestId = "";
InputConfig inputConfig = new InputConfig();
ImportErrorsConfig errorsConfig = new ImportErrorsConfig();
// Make the request
Operation<ImportUserEventsResponse, ImportMetadata> response = await userEventServiceClient.ImportUserEventsAsync(parent, requestId, inputConfig, errorsConfig);

// Poll until the returned long-running operation is complete
Operation<ImportUserEventsResponse, ImportMetadata> 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, ImportMetadata> 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;
}

ListUserEvents(EventStoreName, string, string, int?, CallSettings)

public virtual PagedEnumerable<ListUserEventsResponse, UserEvent> ListUserEvents(EventStoreName parent, string filter, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

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

Parameters
Name Description
parent EventStoreName

Required. The parent eventStore resource name, such as projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store.

filter string

Optional. Filtering expression to specify restrictions over returned events. This is a sequence of terms, where each term applies some kind of a restriction to the returned user events. Use this expression to restrict results to a specific time range, or filter events by eventType. eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems eventTime<"2012-04-23T18:25:43.511Z" eventType=search

We expect only 3 types of fields:

  • eventTime: this can be specified a maximum of 2 times, once with a less than operator and once with a greater than operator. The eventTime restrict should result in one contiguous valid eventTime range.

  • eventType: only 1 eventType restriction can be specified.

  • eventsMissingCatalogItems: specififying this will restrict results to events for which catalog items were not found in the catalog. The default behavior is to return only those events for which catalog items were found.

Some examples of valid filters expressions:

  • Example 1: eventTime > "2012-04-23T18:25:43.511Z" eventTime < "2012-04-23T18:30:43.511Z"
  • Example 2: eventTime > "2012-04-23T18:25:43.511Z" eventType = detail-page-view
  • Example 3: eventsMissingCatalogItems eventType = search eventTime < "2018-04-23T18:30:43.511Z"
  • Example 4: eventTime > "2012-04-23T18:25:43.511Z"
  • Example 5: eventType = search
  • Example 6: eventsMissingCatalogItems
pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListUserEventsResponseUserEvent

A pageable sequence of UserEvent resources.

Example
// Create client
UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create();
// Initialize request argument(s)
EventStoreName parent = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
string filter = "";
// Make the request
PagedEnumerable<ListUserEventsResponse, UserEvent> response = userEventServiceClient.ListUserEvents(parent, filter);

// Iterate over all response items, lazily performing RPCs as required
foreach (UserEvent item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListUserEventsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (UserEvent item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<UserEvent> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (UserEvent item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListUserEvents(ListUserEventsRequest, CallSettings)

public virtual PagedEnumerable<ListUserEventsResponse, UserEvent> ListUserEvents(ListUserEventsRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request ListUserEventsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListUserEventsResponseUserEvent

A pageable sequence of UserEvent resources.

Example
// Create client
UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create();
// Initialize request argument(s)
ListUserEventsRequest request = new ListUserEventsRequest
{
    ParentAsEventStoreName = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"),
    Filter = "",
};
// Make the request
PagedEnumerable<ListUserEventsResponse, UserEvent> response = userEventServiceClient.ListUserEvents(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (UserEvent item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListUserEventsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (UserEvent item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<UserEvent> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (UserEvent item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListUserEvents(string, string, string, int?, CallSettings)

public virtual PagedEnumerable<ListUserEventsResponse, UserEvent> ListUserEvents(string parent, string filter, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

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

Parameters
Name Description
parent string

Required. The parent eventStore resource name, such as projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store.

filter string

Optional. Filtering expression to specify restrictions over returned events. This is a sequence of terms, where each term applies some kind of a restriction to the returned user events. Use this expression to restrict results to a specific time range, or filter events by eventType. eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems eventTime<"2012-04-23T18:25:43.511Z" eventType=search

We expect only 3 types of fields:

  • eventTime: this can be specified a maximum of 2 times, once with a less than operator and once with a greater than operator. The eventTime restrict should result in one contiguous valid eventTime range.

  • eventType: only 1 eventType restriction can be specified.

  • eventsMissingCatalogItems: specififying this will restrict results to events for which catalog items were not found in the catalog. The default behavior is to return only those events for which catalog items were found.

Some examples of valid filters expressions:

  • Example 1: eventTime > "2012-04-23T18:25:43.511Z" eventTime < "2012-04-23T18:30:43.511Z"
  • Example 2: eventTime > "2012-04-23T18:25:43.511Z" eventType = detail-page-view
  • Example 3: eventsMissingCatalogItems eventType = search eventTime < "2018-04-23T18:30:43.511Z"
  • Example 4: eventTime > "2012-04-23T18:25:43.511Z"
  • Example 5: eventType = search
  • Example 6: eventsMissingCatalogItems
pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListUserEventsResponseUserEvent

A pageable sequence of UserEvent resources.

Example
// Create client
UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/eventStores/[EVENT_STORE]";
string filter = "";
// Make the request
PagedEnumerable<ListUserEventsResponse, UserEvent> response = userEventServiceClient.ListUserEvents(parent, filter);

// Iterate over all response items, lazily performing RPCs as required
foreach (UserEvent item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListUserEventsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (UserEvent item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<UserEvent> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (UserEvent item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListUserEventsAsync(EventStoreName, string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListUserEventsResponse, UserEvent> ListUserEventsAsync(EventStoreName parent, string filter, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

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

Parameters
Name Description
parent EventStoreName

Required. The parent eventStore resource name, such as projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store.

filter string

Optional. Filtering expression to specify restrictions over returned events. This is a sequence of terms, where each term applies some kind of a restriction to the returned user events. Use this expression to restrict results to a specific time range, or filter events by eventType. eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems eventTime<"2012-04-23T18:25:43.511Z" eventType=search

We expect only 3 types of fields:

  • eventTime: this can be specified a maximum of 2 times, once with a less than operator and once with a greater than operator. The eventTime restrict should result in one contiguous valid eventTime range.

  • eventType: only 1 eventType restriction can be specified.

  • eventsMissingCatalogItems: specififying this will restrict results to events for which catalog items were not found in the catalog. The default behavior is to return only those events for which catalog items were found.

Some examples of valid filters expressions:

  • Example 1: eventTime > "2012-04-23T18:25:43.511Z" eventTime < "2012-04-23T18:30:43.511Z"
  • Example 2: eventTime > "2012-04-23T18:25:43.511Z" eventType = detail-page-view
  • Example 3: eventsMissingCatalogItems eventType = search eventTime < "2018-04-23T18:30:43.511Z"
  • Example 4: eventTime > "2012-04-23T18:25:43.511Z"
  • Example 5: eventType = search
  • Example 6: eventsMissingCatalogItems
pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListUserEventsResponseUserEvent

A pageable asynchronous sequence of UserEvent resources.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
EventStoreName parent = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
string filter = "";
// Make the request
PagedAsyncEnumerable<ListUserEventsResponse, UserEvent> response = userEventServiceClient.ListUserEventsAsync(parent, filter);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((UserEvent item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListUserEventsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (UserEvent item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<UserEvent> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (UserEvent item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListUserEventsAsync(ListUserEventsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListUserEventsResponse, UserEvent> ListUserEventsAsync(ListUserEventsRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request ListUserEventsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListUserEventsResponseUserEvent

A pageable asynchronous sequence of UserEvent resources.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
ListUserEventsRequest request = new ListUserEventsRequest
{
    ParentAsEventStoreName = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"),
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListUserEventsResponse, UserEvent> response = userEventServiceClient.ListUserEventsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((UserEvent item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListUserEventsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (UserEvent item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<UserEvent> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (UserEvent item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListUserEventsAsync(string, string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListUserEventsResponse, UserEvent> ListUserEventsAsync(string parent, string filter, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

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

Parameters
Name Description
parent string

Required. The parent eventStore resource name, such as projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store.

filter string

Optional. Filtering expression to specify restrictions over returned events. This is a sequence of terms, where each term applies some kind of a restriction to the returned user events. Use this expression to restrict results to a specific time range, or filter events by eventType. eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems eventTime<"2012-04-23T18:25:43.511Z" eventType=search

We expect only 3 types of fields:

  • eventTime: this can be specified a maximum of 2 times, once with a less than operator and once with a greater than operator. The eventTime restrict should result in one contiguous valid eventTime range.

  • eventType: only 1 eventType restriction can be specified.

  • eventsMissingCatalogItems: specififying this will restrict results to events for which catalog items were not found in the catalog. The default behavior is to return only those events for which catalog items were found.

Some examples of valid filters expressions:

  • Example 1: eventTime > "2012-04-23T18:25:43.511Z" eventTime < "2012-04-23T18:30:43.511Z"
  • Example 2: eventTime > "2012-04-23T18:25:43.511Z" eventType = detail-page-view
  • Example 3: eventsMissingCatalogItems eventType = search eventTime < "2018-04-23T18:30:43.511Z"
  • Example 4: eventTime > "2012-04-23T18:25:43.511Z"
  • Example 5: eventType = search
  • Example 6: eventsMissingCatalogItems
pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListUserEventsResponseUserEvent

A pageable asynchronous sequence of UserEvent resources.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/eventStores/[EVENT_STORE]";
string filter = "";
// Make the request
PagedAsyncEnumerable<ListUserEventsResponse, UserEvent> response = userEventServiceClient.ListUserEventsAsync(parent, filter);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((UserEvent item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListUserEventsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (UserEvent item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<UserEvent> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (UserEvent item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

PollOnceImportUserEvents(string, CallSettings)

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

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

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationImportUserEventsResponseImportMetadata

The result of polling the operation.

PollOnceImportUserEventsAsync(string, CallSettings)

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

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

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationImportUserEventsResponseImportMetadata

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 string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationPurgeUserEventsResponsePurgeUserEventsMetadata

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 string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationPurgeUserEventsResponsePurgeUserEventsMetadata

A task representing the result of polling the operation.

PurgeUserEvents(EventStoreName, string, bool, CallSettings)

public virtual Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata> PurgeUserEvents(EventStoreName parent, string filter, bool force, 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
parent EventStoreName

Required. The resource name of the event_store under which the events are created. The format is projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}

filter string

Required. The filter string to specify the events to be deleted. Empty string filter is not allowed. This filter can also be used with ListUserEvents API to list events that will be deleted. The eligible fields for filtering are:

  • eventType - UserEvent.eventType field of type string.
  • eventTime - in ISO 8601 "zulu" format.
  • visitorId - field of type string. Specifying this will delete all events associated with a visitor.
  • userId - field of type string. Specifying this will delete all events associated with a user. Example 1: Deleting all events in a time range. eventTime > "2012-04-23T18:25:43.511Z" eventTime < "2012-04-23T18:30:43.511Z" Example 2: Deleting specific eventType in time range. eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view" Example 3: Deleting all events for a specific visitor visitorId = visitor1024 The filtering fields are assumed to have an implicit AND.
force bool

Optional. The default value is false. Override this flag to true to actually perform the purge. If the field is not set to true, a sampling of events to be deleted will be returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationPurgeUserEventsResponsePurgeUserEventsMetadata

The RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create();
// Initialize request argument(s)
EventStoreName parent = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
string filter = "";
bool force = false;
// Make the request
Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata> response = userEventServiceClient.PurgeUserEvents(parent, filter, force);

// 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;
}

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 PurgeUserEventsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationPurgeUserEventsResponsePurgeUserEventsMetadata

The RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create();
// Initialize request argument(s)
PurgeUserEventsRequest request = new PurgeUserEventsRequest
{
    ParentAsEventStoreName = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_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;
}

PurgeUserEvents(string, string, bool, CallSettings)

public virtual Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata> PurgeUserEvents(string parent, string filter, bool force, 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
parent string

Required. The resource name of the event_store under which the events are created. The format is projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}

filter string

Required. The filter string to specify the events to be deleted. Empty string filter is not allowed. This filter can also be used with ListUserEvents API to list events that will be deleted. The eligible fields for filtering are:

  • eventType - UserEvent.eventType field of type string.
  • eventTime - in ISO 8601 "zulu" format.
  • visitorId - field of type string. Specifying this will delete all events associated with a visitor.
  • userId - field of type string. Specifying this will delete all events associated with a user. Example 1: Deleting all events in a time range. eventTime > "2012-04-23T18:25:43.511Z" eventTime < "2012-04-23T18:30:43.511Z" Example 2: Deleting specific eventType in time range. eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view" Example 3: Deleting all events for a specific visitor visitorId = visitor1024 The filtering fields are assumed to have an implicit AND.
force bool

Optional. The default value is false. Override this flag to true to actually perform the purge. If the field is not set to true, a sampling of events to be deleted will be returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationPurgeUserEventsResponsePurgeUserEventsMetadata

The RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/eventStores/[EVENT_STORE]";
string filter = "";
bool force = false;
// Make the request
Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata> response = userEventServiceClient.PurgeUserEvents(parent, filter, force);

// 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(EventStoreName, string, bool, CallSettings)

public virtual Task<Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata>> PurgeUserEventsAsync(EventStoreName parent, string filter, bool force, 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
parent EventStoreName

Required. The resource name of the event_store under which the events are created. The format is projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}

filter string

Required. The filter string to specify the events to be deleted. Empty string filter is not allowed. This filter can also be used with ListUserEvents API to list events that will be deleted. The eligible fields for filtering are:

  • eventType - UserEvent.eventType field of type string.
  • eventTime - in ISO 8601 "zulu" format.
  • visitorId - field of type string. Specifying this will delete all events associated with a visitor.
  • userId - field of type string. Specifying this will delete all events associated with a user. Example 1: Deleting all events in a time range. eventTime > "2012-04-23T18:25:43.511Z" eventTime < "2012-04-23T18:30:43.511Z" Example 2: Deleting specific eventType in time range. eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view" Example 3: Deleting all events for a specific visitor visitorId = visitor1024 The filtering fields are assumed to have an implicit AND.
force bool

Optional. The default value is false. Override this flag to true to actually perform the purge. If the field is not set to true, a sampling of events to be deleted will be returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationPurgeUserEventsResponsePurgeUserEventsMetadata

A Task containing the RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
EventStoreName parent = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
string filter = "";
bool force = false;
// Make the request
Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata> response = await userEventServiceClient.PurgeUserEventsAsync(parent, filter, force);

// 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(EventStoreName, string, bool, CancellationToken)

public virtual Task<Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata>> PurgeUserEventsAsync(EventStoreName parent, string filter, bool force, 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
parent EventStoreName

Required. The resource name of the event_store under which the events are created. The format is projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}

filter string

Required. The filter string to specify the events to be deleted. Empty string filter is not allowed. This filter can also be used with ListUserEvents API to list events that will be deleted. The eligible fields for filtering are:

  • eventType - UserEvent.eventType field of type string.
  • eventTime - in ISO 8601 "zulu" format.
  • visitorId - field of type string. Specifying this will delete all events associated with a visitor.
  • userId - field of type string. Specifying this will delete all events associated with a user. Example 1: Deleting all events in a time range. eventTime > "2012-04-23T18:25:43.511Z" eventTime < "2012-04-23T18:30:43.511Z" Example 2: Deleting specific eventType in time range. eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view" Example 3: Deleting all events for a specific visitor visitorId = visitor1024 The filtering fields are assumed to have an implicit AND.
force bool

Optional. The default value is false. Override this flag to true to actually perform the purge. If the field is not set to true, a sampling of events to be deleted will be returned.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationPurgeUserEventsResponsePurgeUserEventsMetadata

A Task containing the RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
EventStoreName parent = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
string filter = "";
bool force = false;
// Make the request
Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata> response = await userEventServiceClient.PurgeUserEventsAsync(parent, filter, force);

// 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, 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 PurgeUserEventsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationPurgeUserEventsResponsePurgeUserEventsMetadata

A Task containing the RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
PurgeUserEventsRequest request = new PurgeUserEventsRequest
{
    ParentAsEventStoreName = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_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 PurgeUserEventsRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationPurgeUserEventsResponsePurgeUserEventsMetadata

A Task containing the RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
PurgeUserEventsRequest request = new PurgeUserEventsRequest
{
    ParentAsEventStoreName = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_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(string, string, bool, CallSettings)

public virtual Task<Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata>> PurgeUserEventsAsync(string parent, string filter, bool force, 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
parent string

Required. The resource name of the event_store under which the events are created. The format is projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}

filter string

Required. The filter string to specify the events to be deleted. Empty string filter is not allowed. This filter can also be used with ListUserEvents API to list events that will be deleted. The eligible fields for filtering are:

  • eventType - UserEvent.eventType field of type string.
  • eventTime - in ISO 8601 "zulu" format.
  • visitorId - field of type string. Specifying this will delete all events associated with a visitor.
  • userId - field of type string. Specifying this will delete all events associated with a user. Example 1: Deleting all events in a time range. eventTime > "2012-04-23T18:25:43.511Z" eventTime < "2012-04-23T18:30:43.511Z" Example 2: Deleting specific eventType in time range. eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view" Example 3: Deleting all events for a specific visitor visitorId = visitor1024 The filtering fields are assumed to have an implicit AND.
force bool

Optional. The default value is false. Override this flag to true to actually perform the purge. If the field is not set to true, a sampling of events to be deleted will be returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationPurgeUserEventsResponsePurgeUserEventsMetadata

A Task containing the RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/eventStores/[EVENT_STORE]";
string filter = "";
bool force = false;
// Make the request
Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata> response = await userEventServiceClient.PurgeUserEventsAsync(parent, filter, force);

// 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(string, string, bool, CancellationToken)

public virtual Task<Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata>> PurgeUserEventsAsync(string parent, string filter, bool force, 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
parent string

Required. The resource name of the event_store under which the events are created. The format is projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}

filter string

Required. The filter string to specify the events to be deleted. Empty string filter is not allowed. This filter can also be used with ListUserEvents API to list events that will be deleted. The eligible fields for filtering are:

  • eventType - UserEvent.eventType field of type string.
  • eventTime - in ISO 8601 "zulu" format.
  • visitorId - field of type string. Specifying this will delete all events associated with a visitor.
  • userId - field of type string. Specifying this will delete all events associated with a user. Example 1: Deleting all events in a time range. eventTime > "2012-04-23T18:25:43.511Z" eventTime < "2012-04-23T18:30:43.511Z" Example 2: Deleting specific eventType in time range. eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view" Example 3: Deleting all events for a specific visitor visitorId = visitor1024 The filtering fields are assumed to have an implicit AND.
force bool

Optional. The default value is false. Override this flag to true to actually perform the purge. If the field is not set to true, a sampling of events to be deleted will be returned.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationPurgeUserEventsResponsePurgeUserEventsMetadata

A Task containing the RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/eventStores/[EVENT_STORE]";
string filter = "";
bool force = false;
// Make the request
Operation<PurgeUserEventsResponse, PurgeUserEventsMetadata> response = await userEventServiceClient.PurgeUserEventsAsync(parent, filter, force);

// 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() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
Type Description
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.

WriteUserEvent(EventStoreName, UserEvent, CallSettings)

public virtual UserEvent WriteUserEvent(EventStoreName parent, UserEvent userEvent, CallSettings callSettings = null)

Writes a single user event.

Parameters
Name Description
parent EventStoreName

Required. The parent eventStore resource name, such as projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store.

userEvent UserEvent

Required. User event to write.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
UserEvent

The RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create();
// Initialize request argument(s)
EventStoreName parent = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
UserEvent userEvent = new UserEvent();
// Make the request
UserEvent response = userEventServiceClient.WriteUserEvent(parent, userEvent);

WriteUserEvent(WriteUserEventRequest, CallSettings)

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

Writes a single user event.

Parameters
Name Description
request WriteUserEventRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
UserEvent

The RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create();
// Initialize request argument(s)
WriteUserEventRequest request = new WriteUserEventRequest
{
    ParentAsEventStoreName = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"),
    UserEvent = new UserEvent(),
};
// Make the request
UserEvent response = userEventServiceClient.WriteUserEvent(request);

WriteUserEvent(string, UserEvent, CallSettings)

public virtual UserEvent WriteUserEvent(string parent, UserEvent userEvent, CallSettings callSettings = null)

Writes a single user event.

Parameters
Name Description
parent string

Required. The parent eventStore resource name, such as projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store.

userEvent UserEvent

Required. User event to write.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
UserEvent

The RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/eventStores/[EVENT_STORE]";
UserEvent userEvent = new UserEvent();
// Make the request
UserEvent response = userEventServiceClient.WriteUserEvent(parent, userEvent);

WriteUserEventAsync(EventStoreName, UserEvent, CallSettings)

public virtual Task<UserEvent> WriteUserEventAsync(EventStoreName parent, UserEvent userEvent, CallSettings callSettings = null)

Writes a single user event.

Parameters
Name Description
parent EventStoreName

Required. The parent eventStore resource name, such as projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store.

userEvent UserEvent

Required. User event to write.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskUserEvent

A Task containing the RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
EventStoreName parent = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
UserEvent userEvent = new UserEvent();
// Make the request
UserEvent response = await userEventServiceClient.WriteUserEventAsync(parent, userEvent);

WriteUserEventAsync(EventStoreName, UserEvent, CancellationToken)

public virtual Task<UserEvent> WriteUserEventAsync(EventStoreName parent, UserEvent userEvent, CancellationToken cancellationToken)

Writes a single user event.

Parameters
Name Description
parent EventStoreName

Required. The parent eventStore resource name, such as projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store.

userEvent UserEvent

Required. User event to write.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskUserEvent

A Task containing the RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
EventStoreName parent = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
UserEvent userEvent = new UserEvent();
// Make the request
UserEvent response = await userEventServiceClient.WriteUserEventAsync(parent, userEvent);

WriteUserEventAsync(WriteUserEventRequest, CallSettings)

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

Writes a single user event.

Parameters
Name Description
request WriteUserEventRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskUserEvent

A Task containing the RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
WriteUserEventRequest request = new WriteUserEventRequest
{
    ParentAsEventStoreName = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"),
    UserEvent = new UserEvent(),
};
// 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 WriteUserEventRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskUserEvent

A Task containing the RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
WriteUserEventRequest request = new WriteUserEventRequest
{
    ParentAsEventStoreName = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"),
    UserEvent = new UserEvent(),
};
// Make the request
UserEvent response = await userEventServiceClient.WriteUserEventAsync(request);

WriteUserEventAsync(string, UserEvent, CallSettings)

public virtual Task<UserEvent> WriteUserEventAsync(string parent, UserEvent userEvent, CallSettings callSettings = null)

Writes a single user event.

Parameters
Name Description
parent string

Required. The parent eventStore resource name, such as projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store.

userEvent UserEvent

Required. User event to write.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskUserEvent

A Task containing the RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/eventStores/[EVENT_STORE]";
UserEvent userEvent = new UserEvent();
// Make the request
UserEvent response = await userEventServiceClient.WriteUserEventAsync(parent, userEvent);

WriteUserEventAsync(string, UserEvent, CancellationToken)

public virtual Task<UserEvent> WriteUserEventAsync(string parent, UserEvent userEvent, CancellationToken cancellationToken)

Writes a single user event.

Parameters
Name Description
parent string

Required. The parent eventStore resource name, such as projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store.

userEvent UserEvent

Required. User event to write.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskUserEvent

A Task containing the RPC response.

Example
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/eventStores/[EVENT_STORE]";
UserEvent userEvent = new UserEvent();
// Make the request
UserEvent response = await userEventServiceClient.WriteUserEventAsync(parent, userEvent);