Class UserEventServiceClient
UserEventService client wrapper, for convenient use.
Inherited Members
Namespace: Google.Cloud.Retail.V2
Assembly: Google.Cloud.Retail.V2.dll
Syntax
public abstract class UserEventServiceClient
Remarks
Service for ingesting end user actions on the customer website.
Properties
DefaultEndpoint
The default endpoint for the UserEventService service, which is a host of "retail.googleapis.com" and a port of 443.
Declaration
public static string DefaultEndpoint { get; }
Property Value
Type | Description |
---|---|
System.String |
DefaultScopes
The default UserEventService scopes.
Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.String> |
Remarks
The default UserEventService scopes are:
GrpcClient
The underlying gRPC UserEventService client
Declaration
public virtual UserEventService.UserEventServiceClient GrpcClient { get; }
Property Value
Type | Description |
---|---|
UserEventService.UserEventServiceClient |
ImportUserEventsOperationsClient
The long-running operations client for ImportUserEvents
.
Declaration
public virtual OperationsClient ImportUserEventsOperationsClient { get; }
Property Value
Type | Description |
---|---|
OperationsClient |
PurgeUserEventsOperationsClient
The long-running operations client for PurgeUserEvents
.
Declaration
public virtual OperationsClient PurgeUserEventsOperationsClient { get; }
Property Value
Type | Description |
---|---|
OperationsClient |
RejoinUserEventsOperationsClient
The long-running operations client for RejoinUserEvents
.
Declaration
public virtual OperationsClient RejoinUserEventsOperationsClient { get; }
Property Value
Type | Description |
---|---|
OperationsClient |
Methods
CollectUserEvent(CollectUserEventRequest, CallSettings)
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 Retail API JavaScript pixel and Google Tag Manager. Users should not call this method directly.
Declaration
public virtual HttpBody CollectUserEvent(CollectUserEventRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
CollectUserEventRequest | request | 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. |
Sample code
// Create client
UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create();
// Initialize request argument(s)
CollectUserEventRequest request = new CollectUserEventRequest
{
Parent = "",
UserEvent = "",
Uri = "",
Ets = 0L,
};
// Make the request
HttpBody response = userEventServiceClient.CollectUserEvent(request);
CollectUserEventAsync(CollectUserEventRequest, CallSettings)
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 Retail API JavaScript pixel and Google Tag Manager. Users should not call this method directly.
Declaration
public virtual Task<HttpBody> CollectUserEventAsync(CollectUserEventRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
CollectUserEventRequest | request | 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 |
---|---|
System.Threading.Tasks.Task<HttpBody> | A Task containing the RPC response. |
Sample code
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
CollectUserEventRequest request = new CollectUserEventRequest
{
Parent = "",
UserEvent = "",
Uri = "",
Ets = 0L,
};
// Make the request
HttpBody response = await userEventServiceClient.CollectUserEventAsync(request);
CollectUserEventAsync(CollectUserEventRequest, 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 Retail API JavaScript pixel and Google Tag Manager. Users should not call this method directly.
Declaration
public virtual Task<HttpBody> CollectUserEventAsync(CollectUserEventRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CollectUserEventRequest | request | The request object containing all of the parameters for the API call. |
System.Threading.CancellationToken | cancellationToken | A System.Threading.CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<HttpBody> | A Task containing the RPC response. |
Sample code
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
CollectUserEventRequest request = new CollectUserEventRequest
{
Parent = "",
UserEvent = "",
Uri = "",
Ets = 0L,
};
// Make the request
HttpBody response = await userEventServiceClient.CollectUserEventAsync(request);
Create()
Synchronously creates a UserEventServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use UserEventServiceClientBuilder.
Declaration
public static UserEventServiceClient Create()
Returns
Type | Description |
---|---|
UserEventServiceClient | The created UserEventServiceClient. |
CreateAsync(CancellationToken)
Asynchronously creates a UserEventServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use UserEventServiceClientBuilder.
Declaration
public static Task<UserEventServiceClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | The System.Threading.CancellationToken to use while creating the client. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<UserEventServiceClient> | The task representing the created UserEventServiceClient. |
ImportUserEvents(ImportUserEventsRequest, CallSettings)
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.
Declaration
public virtual Operation<ImportUserEventsResponse, ImportMetadata> ImportUserEvents(ImportUserEventsRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
ImportUserEventsRequest | request | 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 |
---|---|
Operation<ImportUserEventsResponse, ImportMetadata> | The RPC response. |
Sample code
// Create client
UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create();
// Initialize request argument(s)
ImportUserEventsRequest request = new ImportUserEventsRequest
{
Parent = "",
InputConfig = new UserEventInputConfig(),
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;
}
ImportUserEventsAsync(ImportUserEventsRequest, CallSettings)
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.
Declaration
public virtual Task<Operation<ImportUserEventsResponse, ImportMetadata>> ImportUserEventsAsync(ImportUserEventsRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
ImportUserEventsRequest | request | 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 |
---|---|
System.Threading.Tasks.Task<Operation<ImportUserEventsResponse, ImportMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
ImportUserEventsRequest request = new ImportUserEventsRequest
{
Parent = "",
InputConfig = new UserEventInputConfig(),
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)
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.
Declaration
public virtual Task<Operation<ImportUserEventsResponse, ImportMetadata>> ImportUserEventsAsync(ImportUserEventsRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
ImportUserEventsRequest | request | The request object containing all of the parameters for the API call. |
System.Threading.CancellationToken | cancellationToken | A System.Threading.CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Operation<ImportUserEventsResponse, ImportMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
ImportUserEventsRequest request = new ImportUserEventsRequest
{
Parent = "",
InputConfig = new UserEventInputConfig(),
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;
}
PollOnceImportUserEvents(String, CallSettings)
Poll an operation once, using an operationName
from a previous invocation of ImportUserEvents
.
Declaration
public virtual Operation<ImportUserEventsResponse, ImportMetadata> PollOnceImportUserEvents(string operationName, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | operationName | The name of a previously invoked operation. Must not be |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Operation<ImportUserEventsResponse, ImportMetadata> | The result of polling the operation. |
PollOnceImportUserEventsAsync(String, CallSettings)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
ImportUserEvents
.
Declaration
public virtual Task<Operation<ImportUserEventsResponse, ImportMetadata>> PollOnceImportUserEventsAsync(string operationName, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | operationName | The name of a previously invoked operation. Must not be |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Operation<ImportUserEventsResponse, ImportMetadata>> | A task representing the result of polling the operation. |
PollOncePurgeUserEvents(String, CallSettings)
Poll an operation once, using an operationName
from a previous invocation of PurgeUserEvents
.
Declaration
public virtual Operation<PurgeUserEventsResponse, PurgeMetadata> PollOncePurgeUserEvents(string operationName, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | operationName | The name of a previously invoked operation. Must not be |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Operation<PurgeUserEventsResponse, PurgeMetadata> | The result of polling the operation. |
PollOncePurgeUserEventsAsync(String, CallSettings)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
PurgeUserEvents
.
Declaration
public virtual Task<Operation<PurgeUserEventsResponse, PurgeMetadata>> PollOncePurgeUserEventsAsync(string operationName, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | operationName | The name of a previously invoked operation. Must not be |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Operation<PurgeUserEventsResponse, PurgeMetadata>> | A task representing the result of polling the operation. |
PollOnceRejoinUserEvents(String, CallSettings)
Poll an operation once, using an operationName
from a previous invocation of RejoinUserEvents
.
Declaration
public virtual Operation<RejoinUserEventsResponse, RejoinUserEventsMetadata> PollOnceRejoinUserEvents(string operationName, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | operationName | The name of a previously invoked operation. Must not be |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Operation<RejoinUserEventsResponse, RejoinUserEventsMetadata> | The result of polling the operation. |
PollOnceRejoinUserEventsAsync(String, CallSettings)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
RejoinUserEvents
.
Declaration
public virtual Task<Operation<RejoinUserEventsResponse, RejoinUserEventsMetadata>> PollOnceRejoinUserEventsAsync(string operationName, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | operationName | The name of a previously invoked operation. Must not be |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Operation<RejoinUserEventsResponse, RejoinUserEventsMetadata>> | A task representing the result of polling the operation. |
PurgeUserEvents(PurgeUserEventsRequest, CallSettings)
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.
Declaration
public virtual Operation<PurgeUserEventsResponse, PurgeMetadata> PurgeUserEvents(PurgeUserEventsRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
PurgeUserEventsRequest | request | 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 |
---|---|
Operation<PurgeUserEventsResponse, PurgeMetadata> | The RPC response. |
Sample code
// Create client
UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create();
// Initialize request argument(s)
PurgeUserEventsRequest request = new PurgeUserEventsRequest
{
Parent = "",
Filter = "",
Force = false,
};
// Make the request
Operation<PurgeUserEventsResponse, PurgeMetadata> response = userEventServiceClient.PurgeUserEvents(request);
// Poll until the returned long-running operation is complete
Operation<PurgeUserEventsResponse, PurgeMetadata> 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, PurgeMetadata> retrievedResponse = userEventServiceClient.PollOncePurgeUserEvents(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PurgeUserEventsResponse retrievedResult = retrievedResponse.Result;
}
PurgeUserEventsAsync(PurgeUserEventsRequest, CallSettings)
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.
Declaration
public virtual Task<Operation<PurgeUserEventsResponse, PurgeMetadata>> PurgeUserEventsAsync(PurgeUserEventsRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
PurgeUserEventsRequest | request | 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 |
---|---|
System.Threading.Tasks.Task<Operation<PurgeUserEventsResponse, PurgeMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
PurgeUserEventsRequest request = new PurgeUserEventsRequest
{
Parent = "",
Filter = "",
Force = false,
};
// Make the request
Operation<PurgeUserEventsResponse, PurgeMetadata> response = await userEventServiceClient.PurgeUserEventsAsync(request);
// Poll until the returned long-running operation is complete
Operation<PurgeUserEventsResponse, PurgeMetadata> 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, PurgeMetadata> 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)
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.
Declaration
public virtual Task<Operation<PurgeUserEventsResponse, PurgeMetadata>> PurgeUserEventsAsync(PurgeUserEventsRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
PurgeUserEventsRequest | request | The request object containing all of the parameters for the API call. |
System.Threading.CancellationToken | cancellationToken | A System.Threading.CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Operation<PurgeUserEventsResponse, PurgeMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
PurgeUserEventsRequest request = new PurgeUserEventsRequest
{
Parent = "",
Filter = "",
Force = false,
};
// Make the request
Operation<PurgeUserEventsResponse, PurgeMetadata> response = await userEventServiceClient.PurgeUserEventsAsync(request);
// Poll until the returned long-running operation is complete
Operation<PurgeUserEventsResponse, PurgeMetadata> 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, PurgeMetadata> 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;
}
RejoinUserEvents(RejoinUserEventsRequest, CallSettings)
Triggers a user event rejoin operation with latest product catalog. Events will not be annotated with detailed product information if product is missing from the catalog at the time the user event is ingested, and these events are stored as unjoined events with a limited usage on training and serving. This API can be used to trigger a 'join' operation on specified events with latest version of product catalog. It can also be used to correct events joined with wrong product catalog.
Declaration
public virtual Operation<RejoinUserEventsResponse, RejoinUserEventsMetadata> RejoinUserEvents(RejoinUserEventsRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
RejoinUserEventsRequest | request | 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 |
---|---|
Operation<RejoinUserEventsResponse, RejoinUserEventsMetadata> | The RPC response. |
Sample code
// Create client
UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create();
// Initialize request argument(s)
RejoinUserEventsRequest request = new RejoinUserEventsRequest
{
Parent = "",
UserEventRejoinScope = RejoinUserEventsRequest.Types.UserEventRejoinScope.Unspecified,
};
// Make the request
Operation<RejoinUserEventsResponse, RejoinUserEventsMetadata> response = userEventServiceClient.RejoinUserEvents(request);
// Poll until the returned long-running operation is complete
Operation<RejoinUserEventsResponse, RejoinUserEventsMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
RejoinUserEventsResponse 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<RejoinUserEventsResponse, RejoinUserEventsMetadata> retrievedResponse = userEventServiceClient.PollOnceRejoinUserEvents(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
RejoinUserEventsResponse retrievedResult = retrievedResponse.Result;
}
RejoinUserEventsAsync(RejoinUserEventsRequest, CallSettings)
Triggers a user event rejoin operation with latest product catalog. Events will not be annotated with detailed product information if product is missing from the catalog at the time the user event is ingested, and these events are stored as unjoined events with a limited usage on training and serving. This API can be used to trigger a 'join' operation on specified events with latest version of product catalog. It can also be used to correct events joined with wrong product catalog.
Declaration
public virtual Task<Operation<RejoinUserEventsResponse, RejoinUserEventsMetadata>> RejoinUserEventsAsync(RejoinUserEventsRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
RejoinUserEventsRequest | request | 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 |
---|---|
System.Threading.Tasks.Task<Operation<RejoinUserEventsResponse, RejoinUserEventsMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
RejoinUserEventsRequest request = new RejoinUserEventsRequest
{
Parent = "",
UserEventRejoinScope = RejoinUserEventsRequest.Types.UserEventRejoinScope.Unspecified,
};
// Make the request
Operation<RejoinUserEventsResponse, RejoinUserEventsMetadata> response = await userEventServiceClient.RejoinUserEventsAsync(request);
// Poll until the returned long-running operation is complete
Operation<RejoinUserEventsResponse, RejoinUserEventsMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
RejoinUserEventsResponse 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<RejoinUserEventsResponse, RejoinUserEventsMetadata> retrievedResponse = await userEventServiceClient.PollOnceRejoinUserEventsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
RejoinUserEventsResponse retrievedResult = retrievedResponse.Result;
}
RejoinUserEventsAsync(RejoinUserEventsRequest, CancellationToken)
Triggers a user event rejoin operation with latest product catalog. Events will not be annotated with detailed product information if product is missing from the catalog at the time the user event is ingested, and these events are stored as unjoined events with a limited usage on training and serving. This API can be used to trigger a 'join' operation on specified events with latest version of product catalog. It can also be used to correct events joined with wrong product catalog.
Declaration
public virtual Task<Operation<RejoinUserEventsResponse, RejoinUserEventsMetadata>> RejoinUserEventsAsync(RejoinUserEventsRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
RejoinUserEventsRequest | request | The request object containing all of the parameters for the API call. |
System.Threading.CancellationToken | cancellationToken | A System.Threading.CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Operation<RejoinUserEventsResponse, RejoinUserEventsMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
RejoinUserEventsRequest request = new RejoinUserEventsRequest
{
Parent = "",
UserEventRejoinScope = RejoinUserEventsRequest.Types.UserEventRejoinScope.Unspecified,
};
// Make the request
Operation<RejoinUserEventsResponse, RejoinUserEventsMetadata> response = await userEventServiceClient.RejoinUserEventsAsync(request);
// Poll until the returned long-running operation is complete
Operation<RejoinUserEventsResponse, RejoinUserEventsMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
RejoinUserEventsResponse 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<RejoinUserEventsResponse, RejoinUserEventsMetadata> retrievedResponse = await userEventServiceClient.PollOnceRejoinUserEventsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
RejoinUserEventsResponse retrievedResult = retrievedResponse.Result;
}
ShutdownDefaultChannelsAsync()
Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.
Declaration
public static Task ShutdownDefaultChannelsAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.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(WriteUserEventRequest, CallSettings)
Writes a single user event.
Declaration
public virtual UserEvent WriteUserEvent(WriteUserEventRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
WriteUserEventRequest | request | 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. |
Sample code
// Create client
UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create();
// Initialize request argument(s)
WriteUserEventRequest request = new WriteUserEventRequest
{
Parent = "",
UserEvent = new UserEvent(),
};
// Make the request
UserEvent response = userEventServiceClient.WriteUserEvent(request);
WriteUserEventAsync(WriteUserEventRequest, CallSettings)
Writes a single user event.
Declaration
public virtual Task<UserEvent> WriteUserEventAsync(WriteUserEventRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
WriteUserEventRequest | request | 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 |
---|---|
System.Threading.Tasks.Task<UserEvent> | A Task containing the RPC response. |
Sample code
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
WriteUserEventRequest request = new WriteUserEventRequest
{
Parent = "",
UserEvent = new UserEvent(),
};
// Make the request
UserEvent response = await userEventServiceClient.WriteUserEventAsync(request);
WriteUserEventAsync(WriteUserEventRequest, CancellationToken)
Writes a single user event.
Declaration
public virtual Task<UserEvent> WriteUserEventAsync(WriteUserEventRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
WriteUserEventRequest | request | The request object containing all of the parameters for the API call. |
System.Threading.CancellationToken | cancellationToken | A System.Threading.CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<UserEvent> | A Task containing the RPC response. |
Sample code
// Create client
UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync();
// Initialize request argument(s)
WriteUserEventRequest request = new WriteUserEventRequest
{
Parent = "",
UserEvent = new UserEvent(),
};
// Make the request
UserEvent response = await userEventServiceClient.WriteUserEventAsync(request);