/// <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 BatchProcessDocuments</summary> public void BatchProcessDocuments() { // Snippet: BatchProcessDocuments(string, CallSettings) // Create client DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.Create(); // Initialize request argument(s) string name = "projects/[PROJECT]/locations/[LOCATION]/processors/[PROCESSOR]"; // Make the request Operation <BatchProcessResponse, BatchProcessMetadata> response = documentProcessorServiceClient.BatchProcessDocuments(name); // Poll until the returned long-running operation is complete Operation <BatchProcessResponse, BatchProcessMetadata> completedResponse = response.PollUntilCompleted(); // Retrieve the operation result BatchProcessResponse 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 <BatchProcessResponse, BatchProcessMetadata> retrievedResponse = documentProcessorServiceClient.PollOnceBatchProcessDocuments(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result BatchProcessResponse retrievedResult = retrievedResponse.Result; } // End snippet }
/// <summary>Snippet for BatchProcessDocuments</summary> public void BatchProcessDocumentsRequestObject() { // Snippet: BatchProcessDocuments(BatchProcessRequest, CallSettings) // Create client DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.Create(); // Initialize request argument(s) BatchProcessRequest request = new BatchProcessRequest { ProcessorName = ProcessorName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"), SkipHumanReview = false, InputDocuments = new BatchDocumentsInputConfig(), DocumentOutputConfig = new DocumentOutputConfig(), }; // Make the request Operation <BatchProcessResponse, BatchProcessMetadata> response = documentProcessorServiceClient.BatchProcessDocuments(request); // Poll until the returned long-running operation is complete Operation <BatchProcessResponse, BatchProcessMetadata> completedResponse = response.PollUntilCompleted(); // Retrieve the operation result BatchProcessResponse 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 <BatchProcessResponse, BatchProcessMetadata> retrievedResponse = documentProcessorServiceClient.PollOnceBatchProcessDocuments(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result BatchProcessResponse 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 }
/// <summary>Snippet for ProcessDocument</summary> public void ProcessDocumentResourceNames() { // Snippet: ProcessDocument(ProcessorName, CallSettings) // Create client DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.Create(); // Initialize request argument(s) ProcessorName name = ProcessorName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); // Make the request ProcessResponse response = documentProcessorServiceClient.ProcessDocument(name); // End snippet }
/// <summary>Snippet for ProcessDocument</summary> public void ProcessDocument() { // Snippet: ProcessDocument(string, CallSettings) // Create client DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.Create(); // Initialize request argument(s) string name = "projects/[PROJECT]/locations/[LOCATION]/processors/[PROCESSOR]"; // Make the request ProcessResponse response = documentProcessorServiceClient.ProcessDocument(name); // End snippet }
/// <summary>Snippet for ProcessDocument</summary> public void ProcessDocumentRequestObject() { // Snippet: ProcessDocument(ProcessRequest, CallSettings) // Create client DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.Create(); // Initialize request argument(s) ProcessRequest request = new ProcessRequest { ProcessorName = ProcessorName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"), SkipHumanReview = false, InlineDocument = new Document(), }; // Make the request ProcessResponse response = documentProcessorServiceClient.ProcessDocument(request); // End snippet }