/// <summary>Snippet for ImportUserEventsAsync</summary> public async Task ImportUserEventsResourceNamesAsync() { // Snippet: ImportUserEventsAsync(EventStoreName, string, InputConfig, ImportErrorsConfig, CallSettings) // Additional: ImportUserEventsAsync(EventStoreName, string, InputConfig, ImportErrorsConfig, CancellationToken) // Create client UserEventServiceClient userEventServiceClient = await UserEventServiceClient.CreateAsync(); // Initialize request argument(s) EventStoreName parent = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"); string requestId = ""; InputConfig inputConfig = new InputConfig(); ImportErrorsConfig errorsConfig = new ImportErrorsConfig(); // Make the request Operation <ImportUserEventsResponse, ImportMetadata> response = await userEventServiceClient.ImportUserEventsAsync(parent, requestId, inputConfig, errorsConfig); // 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 }
/// <summary>Snippet for ImportCatalogItems</summary> public void ImportCatalogItemsResourceNames() { // Snippet: ImportCatalogItems(CatalogName, string, InputConfig, ImportErrorsConfig, CallSettings) // Create client CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create(); // Initialize request argument(s) CatalogName parent = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]"); string requestId = ""; InputConfig inputConfig = new InputConfig(); ImportErrorsConfig errorsConfig = new ImportErrorsConfig(); // Make the request Operation <ImportCatalogItemsResponse, ImportMetadata> response = catalogServiceClient.ImportCatalogItems(parent, requestId, inputConfig, errorsConfig); // Poll until the returned long-running operation is complete Operation <ImportCatalogItemsResponse, ImportMetadata> completedResponse = response.PollUntilCompleted(); // Retrieve the operation result ImportCatalogItemsResponse 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 <ImportCatalogItemsResponse, ImportMetadata> retrievedResponse = catalogServiceClient.PollOnceImportCatalogItems(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result ImportCatalogItemsResponse retrievedResult = retrievedResponse.Result; } // End snippet }
/// <summary>Snippet for ImportUserEvents</summary> public void ImportUserEvents() { // Snippet: ImportUserEvents(string, string, InputConfig, ImportErrorsConfig, CallSettings) // Create client UserEventServiceClient userEventServiceClient = UserEventServiceClient.Create(); // Initialize request argument(s) string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/eventStores/[EVENT_STORE]"; string requestId = ""; InputConfig inputConfig = new InputConfig(); ImportErrorsConfig errorsConfig = new ImportErrorsConfig(); // Make the request Operation <ImportUserEventsResponse, ImportMetadata> response = userEventServiceClient.ImportUserEvents(parent, requestId, inputConfig, errorsConfig); // 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 ImportCatalogItemsAsync</summary> public async Task ImportCatalogItemsAsync() { // Snippet: ImportCatalogItemsAsync(string, string, InputConfig, ImportErrorsConfig, CallSettings) // Additional: ImportCatalogItemsAsync(string, string, InputConfig, ImportErrorsConfig, CancellationToken) // Create client CatalogServiceClient catalogServiceClient = await CatalogServiceClient.CreateAsync(); // Initialize request argument(s) string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]"; string requestId = ""; InputConfig inputConfig = new InputConfig(); ImportErrorsConfig errorsConfig = new ImportErrorsConfig(); // Make the request Operation <ImportCatalogItemsResponse, ImportMetadata> response = await catalogServiceClient.ImportCatalogItemsAsync(parent, requestId, inputConfig, errorsConfig); // Poll until the returned long-running operation is complete Operation <ImportCatalogItemsResponse, ImportMetadata> completedResponse = await response.PollUntilCompletedAsync(); // Retrieve the operation result ImportCatalogItemsResponse 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 <ImportCatalogItemsResponse, ImportMetadata> retrievedResponse = await catalogServiceClient.PollOnceImportCatalogItemsAsync(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result ImportCatalogItemsResponse retrievedResult = retrievedResponse.Result; } // End snippet }