public abstract class DocumentProcessorServiceClient
DocumentProcessorService client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.DocumentAI.V1Assembly
Google.Cloud.DocumentAI.V1.dll
Remarks
Service to call Cloud DocumentAI to process documents according to the processor's definition. Processors are built using state-of-the-art Google AI such as natural language, computer vision, and translation to extract structured information from unstructured or semi-structured documents.
Properties
BatchProcessDocumentsOperationsClient
public virtual OperationsClient BatchProcessDocumentsOperationsClient { get; }
The long-running operations client for BatchProcessDocuments
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the DocumentProcessorService service, which is a host of "documentai.googleapis.com" and a port of 443.
Property Value | |
---|---|
Type | Description |
String |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default DocumentProcessorService scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyList<String> |
The default DocumentProcessorService scopes are:
GrpcClient
public virtual DocumentProcessorService.DocumentProcessorServiceClient GrpcClient { get; }
The underlying gRPC DocumentProcessorService client
Property Value | |
---|---|
Type | Description |
DocumentProcessorService.DocumentProcessorServiceClient |
ReviewDocumentOperationsClient
public virtual OperationsClient ReviewDocumentOperationsClient { get; }
The long-running operations client for ReviewDocument
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
Methods
BatchProcessDocuments(BatchProcessRequest, CallSettings)
public virtual Operation<BatchProcessResponse, BatchProcessMetadata> BatchProcessDocuments(BatchProcessRequest request, CallSettings callSettings = null)
LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.
Parameters | |
---|---|
Name | Description |
request | BatchProcessRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<BatchProcessResponse, BatchProcessMetadata> | The RPC response. |
// 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;
}
BatchProcessDocuments(ProcessorName, CallSettings)
public virtual Operation<BatchProcessResponse, BatchProcessMetadata> BatchProcessDocuments(ProcessorName name, CallSettings callSettings = null)
LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.
Parameters | |
---|---|
Name | Description |
name | ProcessorName Required. The processor resource name. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<BatchProcessResponse, BatchProcessMetadata> | The RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.Create();
// Initialize request argument(s)
ProcessorName name = ProcessorName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[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;
}
BatchProcessDocuments(String, CallSettings)
public virtual Operation<BatchProcessResponse, BatchProcessMetadata> BatchProcessDocuments(string name, CallSettings callSettings = null)
LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.
Parameters | |
---|---|
Name | Description |
name | String Required. The processor resource name. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<BatchProcessResponse, BatchProcessMetadata> | The RPC response. |
// 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;
}
BatchProcessDocumentsAsync(BatchProcessRequest, CallSettings)
public virtual Task<Operation<BatchProcessResponse, BatchProcessMetadata>> BatchProcessDocumentsAsync(BatchProcessRequest request, CallSettings callSettings = null)
LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.
Parameters | |
---|---|
Name | Description |
request | BatchProcessRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<BatchProcessResponse, BatchProcessMetadata>> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// 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 = await documentProcessorServiceClient.BatchProcessDocumentsAsync(request);
// Poll until the returned long-running operation is complete
Operation<BatchProcessResponse, BatchProcessMetadata> completedResponse = await response.PollUntilCompletedAsync();
// 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 = await documentProcessorServiceClient.PollOnceBatchProcessDocumentsAsync(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;
}
BatchProcessDocumentsAsync(BatchProcessRequest, CancellationToken)
public virtual Task<Operation<BatchProcessResponse, BatchProcessMetadata>> BatchProcessDocumentsAsync(BatchProcessRequest request, CancellationToken cancellationToken)
LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.
Parameters | |
---|---|
Name | Description |
request | BatchProcessRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<BatchProcessResponse, BatchProcessMetadata>> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// 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 = await documentProcessorServiceClient.BatchProcessDocumentsAsync(request);
// Poll until the returned long-running operation is complete
Operation<BatchProcessResponse, BatchProcessMetadata> completedResponse = await response.PollUntilCompletedAsync();
// 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 = await documentProcessorServiceClient.PollOnceBatchProcessDocumentsAsync(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;
}
BatchProcessDocumentsAsync(ProcessorName, CallSettings)
public virtual Task<Operation<BatchProcessResponse, BatchProcessMetadata>> BatchProcessDocumentsAsync(ProcessorName name, CallSettings callSettings = null)
LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.
Parameters | |
---|---|
Name | Description |
name | ProcessorName Required. The processor resource name. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<BatchProcessResponse, BatchProcessMetadata>> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
ProcessorName name = ProcessorName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
// Make the request
Operation<BatchProcessResponse, BatchProcessMetadata> response = await documentProcessorServiceClient.BatchProcessDocumentsAsync(name);
// Poll until the returned long-running operation is complete
Operation<BatchProcessResponse, BatchProcessMetadata> completedResponse = await response.PollUntilCompletedAsync();
// 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 = await documentProcessorServiceClient.PollOnceBatchProcessDocumentsAsync(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;
}
BatchProcessDocumentsAsync(ProcessorName, CancellationToken)
public virtual Task<Operation<BatchProcessResponse, BatchProcessMetadata>> BatchProcessDocumentsAsync(ProcessorName name, CancellationToken cancellationToken)
LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.
Parameters | |
---|---|
Name | Description |
name | ProcessorName Required. The processor resource name. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<BatchProcessResponse, BatchProcessMetadata>> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
ProcessorName name = ProcessorName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
// Make the request
Operation<BatchProcessResponse, BatchProcessMetadata> response = await documentProcessorServiceClient.BatchProcessDocumentsAsync(name);
// Poll until the returned long-running operation is complete
Operation<BatchProcessResponse, BatchProcessMetadata> completedResponse = await response.PollUntilCompletedAsync();
// 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 = await documentProcessorServiceClient.PollOnceBatchProcessDocumentsAsync(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;
}
BatchProcessDocumentsAsync(String, CallSettings)
public virtual Task<Operation<BatchProcessResponse, BatchProcessMetadata>> BatchProcessDocumentsAsync(string name, CallSettings callSettings = null)
LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.
Parameters | |
---|---|
Name | Description |
name | String Required. The processor resource name. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<BatchProcessResponse, BatchProcessMetadata>> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/processors/[PROCESSOR]";
// Make the request
Operation<BatchProcessResponse, BatchProcessMetadata> response = await documentProcessorServiceClient.BatchProcessDocumentsAsync(name);
// Poll until the returned long-running operation is complete
Operation<BatchProcessResponse, BatchProcessMetadata> completedResponse = await response.PollUntilCompletedAsync();
// 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 = await documentProcessorServiceClient.PollOnceBatchProcessDocumentsAsync(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;
}
BatchProcessDocumentsAsync(String, CancellationToken)
public virtual Task<Operation<BatchProcessResponse, BatchProcessMetadata>> BatchProcessDocumentsAsync(string name, CancellationToken cancellationToken)
LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.
Parameters | |
---|---|
Name | Description |
name | String Required. The processor resource name. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<BatchProcessResponse, BatchProcessMetadata>> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/processors/[PROCESSOR]";
// Make the request
Operation<BatchProcessResponse, BatchProcessMetadata> response = await documentProcessorServiceClient.BatchProcessDocumentsAsync(name);
// Poll until the returned long-running operation is complete
Operation<BatchProcessResponse, BatchProcessMetadata> completedResponse = await response.PollUntilCompletedAsync();
// 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 = await documentProcessorServiceClient.PollOnceBatchProcessDocumentsAsync(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;
}
Create()
public static DocumentProcessorServiceClient Create()
Synchronously creates a DocumentProcessorServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use DocumentProcessorServiceClientBuilder.
Returns | |
---|---|
Type | Description |
DocumentProcessorServiceClient | The created DocumentProcessorServiceClient. |
CreateAsync(CancellationToken)
public static Task<DocumentProcessorServiceClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))
Asynchronously creates a DocumentProcessorServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use DocumentProcessorServiceClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
Task<DocumentProcessorServiceClient> | The task representing the created DocumentProcessorServiceClient. |
PollOnceBatchProcessDocuments(String, CallSettings)
public virtual Operation<BatchProcessResponse, BatchProcessMetadata> PollOnceBatchProcessDocuments(string operationName, CallSettings callSettings = null)
Poll an operation once, using an operationName
from a previous invocation of BatchProcessDocuments
.
Parameters | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<BatchProcessResponse, BatchProcessMetadata> | The result of polling the operation. |
PollOnceBatchProcessDocumentsAsync(String, CallSettings)
public virtual Task<Operation<BatchProcessResponse, BatchProcessMetadata>> PollOnceBatchProcessDocumentsAsync(string operationName, CallSettings callSettings = null)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
BatchProcessDocuments
.
Parameters | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<BatchProcessResponse, BatchProcessMetadata>> | A task representing the result of polling the operation. |
PollOnceReviewDocument(String, CallSettings)
public virtual Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata> PollOnceReviewDocument(string operationName, CallSettings callSettings = null)
Poll an operation once, using an operationName
from a previous invocation of ReviewDocument
.
Parameters | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata> | The result of polling the operation. |
PollOnceReviewDocumentAsync(String, CallSettings)
public virtual Task<Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata>> PollOnceReviewDocumentAsync(string operationName, CallSettings callSettings = null)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
ReviewDocument
.
Parameters | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata>> | A task representing the result of polling the operation. |
ProcessDocument(ProcessorName, CallSettings)
public virtual ProcessResponse ProcessDocument(ProcessorName name, CallSettings callSettings = null)
Processes a single document.
Parameters | |
---|---|
Name | Description |
name | ProcessorName Required. The processor resource name. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
ProcessResponse | The RPC response. |
// 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);
ProcessDocument(ProcessRequest, CallSettings)
public virtual ProcessResponse ProcessDocument(ProcessRequest request, CallSettings callSettings = null)
Processes a single document.
Parameters | |
---|---|
Name | Description |
request | ProcessRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
ProcessResponse | The RPC response. |
// 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);
ProcessDocument(String, CallSettings)
public virtual ProcessResponse ProcessDocument(string name, CallSettings callSettings = null)
Processes a single document.
Parameters | |
---|---|
Name | Description |
name | String Required. The processor resource name. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
ProcessResponse | The RPC response. |
// 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);
ProcessDocumentAsync(ProcessorName, CallSettings)
public virtual Task<ProcessResponse> ProcessDocumentAsync(ProcessorName name, CallSettings callSettings = null)
Processes a single document.
Parameters | |
---|---|
Name | Description |
name | ProcessorName Required. The processor resource name. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<ProcessResponse> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
ProcessorName name = ProcessorName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
// Make the request
ProcessResponse response = await documentProcessorServiceClient.ProcessDocumentAsync(name);
ProcessDocumentAsync(ProcessorName, CancellationToken)
public virtual Task<ProcessResponse> ProcessDocumentAsync(ProcessorName name, CancellationToken cancellationToken)
Processes a single document.
Parameters | |
---|---|
Name | Description |
name | ProcessorName Required. The processor resource name. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<ProcessResponse> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
ProcessorName name = ProcessorName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
// Make the request
ProcessResponse response = await documentProcessorServiceClient.ProcessDocumentAsync(name);
ProcessDocumentAsync(ProcessRequest, CallSettings)
public virtual Task<ProcessResponse> ProcessDocumentAsync(ProcessRequest request, CallSettings callSettings = null)
Processes a single document.
Parameters | |
---|---|
Name | Description |
request | ProcessRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<ProcessResponse> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
ProcessRequest request = new ProcessRequest
{
ProcessorName = ProcessorName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"),
SkipHumanReview = false,
InlineDocument = new Document(),
};
// Make the request
ProcessResponse response = await documentProcessorServiceClient.ProcessDocumentAsync(request);
ProcessDocumentAsync(ProcessRequest, CancellationToken)
public virtual Task<ProcessResponse> ProcessDocumentAsync(ProcessRequest request, CancellationToken cancellationToken)
Processes a single document.
Parameters | |
---|---|
Name | Description |
request | ProcessRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<ProcessResponse> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
ProcessRequest request = new ProcessRequest
{
ProcessorName = ProcessorName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"),
SkipHumanReview = false,
InlineDocument = new Document(),
};
// Make the request
ProcessResponse response = await documentProcessorServiceClient.ProcessDocumentAsync(request);
ProcessDocumentAsync(String, CallSettings)
public virtual Task<ProcessResponse> ProcessDocumentAsync(string name, CallSettings callSettings = null)
Processes a single document.
Parameters | |
---|---|
Name | Description |
name | String Required. The processor resource name. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<ProcessResponse> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/processors/[PROCESSOR]";
// Make the request
ProcessResponse response = await documentProcessorServiceClient.ProcessDocumentAsync(name);
ProcessDocumentAsync(String, CancellationToken)
public virtual Task<ProcessResponse> ProcessDocumentAsync(string name, CancellationToken cancellationToken)
Processes a single document.
Parameters | |
---|---|
Name | Description |
name | String Required. The processor resource name. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<ProcessResponse> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/processors/[PROCESSOR]";
// Make the request
ProcessResponse response = await documentProcessorServiceClient.ProcessDocumentAsync(name);
ReviewDocument(HumanReviewConfigName, CallSettings)
public virtual Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata> ReviewDocument(HumanReviewConfigName humanReviewConfig, CallSettings callSettings = null)
Send a document for Human Review. The input document should be processed by the specified processor.
Parameters | |
---|---|
Name | Description |
humanReviewConfig | HumanReviewConfigName Required. The resource name of the HumanReviewConfig that the document will be reviewed with. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata> | The RPC response. |
// 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;
}
ReviewDocument(ReviewDocumentRequest, CallSettings)
public virtual Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata> ReviewDocument(ReviewDocumentRequest request, CallSettings callSettings = null)
Send a document for Human Review. The input document should be processed by the specified processor.
Parameters | |
---|---|
Name | Description |
request | ReviewDocumentRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata> | The RPC response. |
// 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;
}
ReviewDocument(String, CallSettings)
public virtual Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata> ReviewDocument(string humanReviewConfig, CallSettings callSettings = null)
Send a document for Human Review. The input document should be processed by the specified processor.
Parameters | |
---|---|
Name | Description |
humanReviewConfig | String Required. The resource name of the HumanReviewConfig that the document will be reviewed with. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata> | The RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.Create();
// Initialize request argument(s)
string humanReviewConfig = "projects/[PROJECT]/locations/[LOCATION]/processors/[PROCESSOR]/humanReviewConfig";
// 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;
}
ReviewDocumentAsync(HumanReviewConfigName, CallSettings)
public virtual Task<Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata>> ReviewDocumentAsync(HumanReviewConfigName humanReviewConfig, CallSettings callSettings = null)
Send a document for Human Review. The input document should be processed by the specified processor.
Parameters | |
---|---|
Name | Description |
humanReviewConfig | HumanReviewConfigName Required. The resource name of the HumanReviewConfig that the document will be reviewed with. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
HumanReviewConfigName humanReviewConfig = HumanReviewConfigName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
// Make the request
Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata> response = await documentProcessorServiceClient.ReviewDocumentAsync(humanReviewConfig);
// Poll until the returned long-running operation is complete
Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// 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 = await documentProcessorServiceClient.PollOnceReviewDocumentAsync(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;
}
ReviewDocumentAsync(HumanReviewConfigName, CancellationToken)
public virtual Task<Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata>> ReviewDocumentAsync(HumanReviewConfigName humanReviewConfig, CancellationToken cancellationToken)
Send a document for Human Review. The input document should be processed by the specified processor.
Parameters | |
---|---|
Name | Description |
humanReviewConfig | HumanReviewConfigName Required. The resource name of the HumanReviewConfig that the document will be reviewed with. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
HumanReviewConfigName humanReviewConfig = HumanReviewConfigName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
// Make the request
Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata> response = await documentProcessorServiceClient.ReviewDocumentAsync(humanReviewConfig);
// Poll until the returned long-running operation is complete
Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// 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 = await documentProcessorServiceClient.PollOnceReviewDocumentAsync(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;
}
ReviewDocumentAsync(ReviewDocumentRequest, CallSettings)
public virtual Task<Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata>> ReviewDocumentAsync(ReviewDocumentRequest request, CallSettings callSettings = null)
Send a document for Human Review. The input document should be processed by the specified processor.
Parameters | |
---|---|
Name | Description |
request | ReviewDocumentRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// 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 = await documentProcessorServiceClient.ReviewDocumentAsync(request);
// Poll until the returned long-running operation is complete
Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// 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 = await documentProcessorServiceClient.PollOnceReviewDocumentAsync(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;
}
ReviewDocumentAsync(ReviewDocumentRequest, CancellationToken)
public virtual Task<Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata>> ReviewDocumentAsync(ReviewDocumentRequest request, CancellationToken cancellationToken)
Send a document for Human Review. The input document should be processed by the specified processor.
Parameters | |
---|---|
Name | Description |
request | ReviewDocumentRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// 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 = await documentProcessorServiceClient.ReviewDocumentAsync(request);
// Poll until the returned long-running operation is complete
Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// 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 = await documentProcessorServiceClient.PollOnceReviewDocumentAsync(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;
}
ReviewDocumentAsync(String, CallSettings)
public virtual Task<Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata>> ReviewDocumentAsync(string humanReviewConfig, CallSettings callSettings = null)
Send a document for Human Review. The input document should be processed by the specified processor.
Parameters | |
---|---|
Name | Description |
humanReviewConfig | String Required. The resource name of the HumanReviewConfig that the document will be reviewed with. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
string humanReviewConfig = "projects/[PROJECT]/locations/[LOCATION]/processors/[PROCESSOR]/humanReviewConfig";
// Make the request
Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata> response = await documentProcessorServiceClient.ReviewDocumentAsync(humanReviewConfig);
// Poll until the returned long-running operation is complete
Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// 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 = await documentProcessorServiceClient.PollOnceReviewDocumentAsync(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;
}
ReviewDocumentAsync(String, CancellationToken)
public virtual Task<Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata>> ReviewDocumentAsync(string humanReviewConfig, CancellationToken cancellationToken)
Send a document for Human Review. The input document should be processed by the specified processor.
Parameters | |
---|---|
Name | Description |
humanReviewConfig | String Required. The resource name of the HumanReviewConfig that the document will be reviewed with. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
string humanReviewConfig = "projects/[PROJECT]/locations/[LOCATION]/processors/[PROCESSOR]/humanReviewConfig";
// Make the request
Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata> response = await documentProcessorServiceClient.ReviewDocumentAsync(humanReviewConfig);
// Poll until the returned long-running operation is complete
Operation<ReviewDocumentResponse, ReviewDocumentOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// 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 = await documentProcessorServiceClient.PollOnceReviewDocumentAsync(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;
}
ShutdownDefaultChannelsAsync()
public static Task ShutdownDefaultChannelsAsync()
Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.
Returns | |
---|---|
Type | Description |
Task | A task representing the asynchronous shutdown operation. |
After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.