/// <summary>Snippet for AsyncBatchAnnotateFilesAsync</summary> public async Task AsyncBatchAnnotateFilesAsync() { // Snippet: AsyncBatchAnnotateFilesAsync(IEnumerable<AsyncAnnotateFileRequest>,CallSettings) // Additional: AsyncBatchAnnotateFilesAsync(IEnumerable<AsyncAnnotateFileRequest>,CancellationToken) // Create client ImageAnnotatorClient imageAnnotatorClient = await ImageAnnotatorClient.CreateAsync(); // Initialize request argument(s) IEnumerable <AsyncAnnotateFileRequest> requests = new List <AsyncAnnotateFileRequest>(); // Make the request Operation <AsyncBatchAnnotateFilesResponse, OperationMetadata> response = await imageAnnotatorClient.AsyncBatchAnnotateFilesAsync(requests); // Poll until the returned long-running operation is complete Operation <AsyncBatchAnnotateFilesResponse, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync(); // Retrieve the operation result AsyncBatchAnnotateFilesResponse 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 <AsyncBatchAnnotateFilesResponse, OperationMetadata> retrievedResponse = await imageAnnotatorClient.PollOnceAsyncBatchAnnotateFilesAsync(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result AsyncBatchAnnotateFilesResponse retrievedResult = retrievedResponse.Result; } // End snippet }