Search in sources :

Example 1 with RejoinUserEventsResponse

use of com.google.cloud.retail.v2.RejoinUserEventsResponse in project java-retail by googleapis.

the class RejoinUserEvent method callRejoinUserEvents.

public static void callRejoinUserEvents(String defaultCatalog, String visitorId) throws IOException, ExecutionException, InterruptedException {
    writeUserEvent(visitorId);
    // the "close" method on the client to safely clean up any remaining background resources.
    try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
        RejoinUserEventsRequest rejoinUserEventsRequest = RejoinUserEventsRequest.newBuilder().setParent(defaultCatalog).setUserEventRejoinScope(UserEventRejoinScope.UNJOINED_EVENTS).build();
        System.out.printf("Rejoin user events request: %s%n", rejoinUserEventsRequest);
        OperationFuture<RejoinUserEventsResponse, RejoinUserEventsMetadata> rejoinOperation = userEventServiceClient.rejoinUserEventsAsync(rejoinUserEventsRequest);
        System.out.printf("The rejoin operation was started: %s%n", rejoinOperation.getName());
    }
    purgeUserEvent(visitorId);
}
Also used : RejoinUserEventsRequest(com.google.cloud.retail.v2.RejoinUserEventsRequest) RejoinUserEventsResponse(com.google.cloud.retail.v2.RejoinUserEventsResponse) RejoinUserEventsMetadata(com.google.cloud.retail.v2.RejoinUserEventsMetadata) UserEventServiceClient(com.google.cloud.retail.v2.UserEventServiceClient)

Aggregations

RejoinUserEventsMetadata (com.google.cloud.retail.v2.RejoinUserEventsMetadata)1 RejoinUserEventsRequest (com.google.cloud.retail.v2.RejoinUserEventsRequest)1 RejoinUserEventsResponse (com.google.cloud.retail.v2.RejoinUserEventsResponse)1 UserEventServiceClient (com.google.cloud.retail.v2.UserEventServiceClient)1