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);
}
Aggregations