/// <summary>Snippet for ImportUserEvents</summary> public void ImportUserEventsRequestObject() { // Snippet: ImportUserEvents(ImportUserEventsRequest, CallSettings) // Create client UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create(); // Initialize request argument(s) ImportUserEventsRequest request = new ImportUserEventsRequest { ParentAsCatalogName = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]"), 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; } // End snippet }
/// <summary>Snippet for ImportUserEventsAsync</summary> public async Task ImportUserEventsRequestObjectAsync() { // Snippet: ImportUserEventsAsync(ImportUserEventsRequest, CallSettings) // Additional: ImportUserEventsAsync(ImportUserEventsRequest, CancellationToken) // 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; } // End snippet }