/// <summary>Snippet for ReviewDocument</summary> public void ReviewDocumentResourceNames() { // Snippet: ReviewDocument(HumanReviewConfigName, CallSettings) // Create client DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.Create(); // Initialize request argument(s) HumanReviewConfigName humanReviewConfig = HumanReviewConfigName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); // Make the request Operation <ReviewDocumentResponse, ReviewDocumentOperationMetadata> response = documentProcessorServiceClient.ReviewDocument(humanReviewConfig); // Poll until the returned long-running operation is complete Operation <ReviewDocumentResponse, ReviewDocumentOperationMetadata> completedResponse = response.PollUntilCompleted(); // Retrieve the operation result ReviewDocumentResponse 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 <ReviewDocumentResponse, ReviewDocumentOperationMetadata> retrievedResponse = documentProcessorServiceClient.PollOnceReviewDocument(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result ReviewDocumentResponse retrievedResult = retrievedResponse.Result; } // End snippet }
/// <summary>Snippet for ReviewDocument</summary> public void ReviewDocumentRequestObject() { // Snippet: ReviewDocument(ReviewDocumentRequest, CallSettings) // Create client DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.Create(); // Initialize request argument(s) ReviewDocumentRequest request = new ReviewDocumentRequest { HumanReviewConfigAsHumanReviewConfigName = HumanReviewConfigName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"), EnableSchemaValidation = false, InlineDocument = new Document(), Priority = ReviewDocumentRequest.Types.Priority.Default, }; // Make the request Operation <ReviewDocumentResponse, ReviewDocumentOperationMetadata> response = documentProcessorServiceClient.ReviewDocument(request); // Poll until the returned long-running operation is complete Operation <ReviewDocumentResponse, ReviewDocumentOperationMetadata> completedResponse = response.PollUntilCompleted(); // Retrieve the operation result ReviewDocumentResponse 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 <ReviewDocumentResponse, ReviewDocumentOperationMetadata> retrievedResponse = documentProcessorServiceClient.PollOnceReviewDocument(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result ReviewDocumentResponse retrievedResult = retrievedResponse.Result; } // End snippet }