pub struct UserEventService { /* private fields */ }user-event-service only.Expand description
Implements a client for the Discovery Engine API.
§Example
let client = UserEventService::builder().build().await?;
// use `client` to make requests to the Discovery Engine API.§Service Description
Service for ingesting end user actions on a website to Discovery Engine API.
§Configuration
To configure UserEventService use the with_* methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://discoveryengine.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§Pooling and Cloning
UserEventService holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap UserEventService in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl UserEventService
impl UserEventService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for UserEventService.
let client = UserEventService::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: UserEventService + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: UserEventService + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client’s behavior.
Sourcepub fn write_user_event(&self) -> WriteUserEvent
pub fn write_user_event(&self) -> WriteUserEvent
Writes a single user event.
Sourcepub fn collect_user_event(&self) -> CollectUserEvent
pub fn collect_user_event(&self) -> CollectUserEvent
Writes a single user event from the browser. This uses a GET request to due to browser restriction of POST-ing to a third-party domain.
This method is used only by the Discovery Engine API JavaScript pixel and Google Tag Manager. Users should not call this method directly.
Sourcepub fn purge_user_events(&self) -> PurgeUserEvents
pub fn purge_user_events(&self) -> PurgeUserEvents
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.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn import_user_events(&self) -> ImportUserEvents
pub fn import_user_events(&self) -> ImportUserEvents
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.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn list_operations(&self) -> ListOperations
pub fn list_operations(&self) -> ListOperations
Provides the Operations service functionality in this service.
Sourcepub fn get_operation(&self) -> GetOperation
pub fn get_operation(&self) -> GetOperation
Provides the Operations service functionality in this service.
Sourcepub fn cancel_operation(&self) -> CancelOperation
pub fn cancel_operation(&self) -> CancelOperation
Provides the Operations service functionality in this service.
Trait Implementations§
Source§impl Clone for UserEventService
impl Clone for UserEventService
Source§fn clone(&self) -> UserEventService
fn clone(&self) -> UserEventService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more