public abstract class DocumentProcessorServiceClient
DocumentProcessorService client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.DocumentAI.V1Beta3Assembly
Google.Cloud.DocumentAI.V1Beta3.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:
DeleteProcessorOperationsClient
public virtual OperationsClient DeleteProcessorOperationsClient { get; }
The long-running operations client for DeleteProcessor
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
DisableProcessorOperationsClient
public virtual OperationsClient DisableProcessorOperationsClient { get; }
The long-running operations client for DisableProcessor
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
EnableProcessorOperationsClient
public virtual OperationsClient EnableProcessorOperationsClient { get; }
The long-running operations client for EnableProcessor
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
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. |
CreateProcessor(LocationName, Processor, CallSettings)
public virtual Processor CreateProcessor(LocationName parent, Processor processor, CallSettings callSettings = null)
Creates a processor from the type processor that the user chose. The processor will be at "ENABLED" state by default after its creation.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The parent (project and location) under which to create the processor. Format: projects/{project}/locations/{location} |
processor | Processor Required. The processor to be created, requires [processor_type] and [display_name] to be set. Also, the processor is under CMEK if CMEK fields are set. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Processor | The RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Processor processor = new Processor();
// Make the request
Processor response = documentProcessorServiceClient.CreateProcessor(parent, processor);
CreateProcessor(CreateProcessorRequest, CallSettings)
public virtual Processor CreateProcessor(CreateProcessorRequest request, CallSettings callSettings = null)
Creates a processor from the type processor that the user chose. The processor will be at "ENABLED" state by default after its creation.
Parameters | |
---|---|
Name | Description |
request | CreateProcessorRequest 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 |
Processor | The RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.Create();
// Initialize request argument(s)
CreateProcessorRequest request = new CreateProcessorRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Processor = new Processor(),
};
// Make the request
Processor response = documentProcessorServiceClient.CreateProcessor(request);
CreateProcessor(String, Processor, CallSettings)
public virtual Processor CreateProcessor(string parent, Processor processor, CallSettings callSettings = null)
Creates a processor from the type processor that the user chose. The processor will be at "ENABLED" state by default after its creation.
Parameters | |
---|---|
Name | Description |
parent | String Required. The parent (project and location) under which to create the processor. Format: projects/{project}/locations/{location} |
processor | Processor Required. The processor to be created, requires [processor_type] and [display_name] to be set. Also, the processor is under CMEK if CMEK fields are set. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Processor | The RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Processor processor = new Processor();
// Make the request
Processor response = documentProcessorServiceClient.CreateProcessor(parent, processor);
CreateProcessorAsync(LocationName, Processor, CallSettings)
public virtual Task<Processor> CreateProcessorAsync(LocationName parent, Processor processor, CallSettings callSettings = null)
Creates a processor from the type processor that the user chose. The processor will be at "ENABLED" state by default after its creation.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The parent (project and location) under which to create the processor. Format: projects/{project}/locations/{location} |
processor | Processor Required. The processor to be created, requires [processor_type] and [display_name] to be set. Also, the processor is under CMEK if CMEK fields are set. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Processor> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Processor processor = new Processor();
// Make the request
Processor response = await documentProcessorServiceClient.CreateProcessorAsync(parent, processor);
CreateProcessorAsync(LocationName, Processor, CancellationToken)
public virtual Task<Processor> CreateProcessorAsync(LocationName parent, Processor processor, CancellationToken cancellationToken)
Creates a processor from the type processor that the user chose. The processor will be at "ENABLED" state by default after its creation.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The parent (project and location) under which to create the processor. Format: projects/{project}/locations/{location} |
processor | Processor Required. The processor to be created, requires [processor_type] and [display_name] to be set. Also, the processor is under CMEK if CMEK fields are set. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Processor> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Processor processor = new Processor();
// Make the request
Processor response = await documentProcessorServiceClient.CreateProcessorAsync(parent, processor);
CreateProcessorAsync(CreateProcessorRequest, CallSettings)
public virtual Task<Processor> CreateProcessorAsync(CreateProcessorRequest request, CallSettings callSettings = null)
Creates a processor from the type processor that the user chose. The processor will be at "ENABLED" state by default after its creation.
Parameters | |
---|---|
Name | Description |
request | CreateProcessorRequest 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<Processor> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
CreateProcessorRequest request = new CreateProcessorRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Processor = new Processor(),
};
// Make the request
Processor response = await documentProcessorServiceClient.CreateProcessorAsync(request);
CreateProcessorAsync(CreateProcessorRequest, CancellationToken)
public virtual Task<Processor> CreateProcessorAsync(CreateProcessorRequest request, CancellationToken cancellationToken)
Creates a processor from the type processor that the user chose. The processor will be at "ENABLED" state by default after its creation.
Parameters | |
---|---|
Name | Description |
request | CreateProcessorRequest 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<Processor> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
CreateProcessorRequest request = new CreateProcessorRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Processor = new Processor(),
};
// Make the request
Processor response = await documentProcessorServiceClient.CreateProcessorAsync(request);
CreateProcessorAsync(String, Processor, CallSettings)
public virtual Task<Processor> CreateProcessorAsync(string parent, Processor processor, CallSettings callSettings = null)
Creates a processor from the type processor that the user chose. The processor will be at "ENABLED" state by default after its creation.
Parameters | |
---|---|
Name | Description |
parent | String Required. The parent (project and location) under which to create the processor. Format: projects/{project}/locations/{location} |
processor | Processor Required. The processor to be created, requires [processor_type] and [display_name] to be set. Also, the processor is under CMEK if CMEK fields are set. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Processor> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Processor processor = new Processor();
// Make the request
Processor response = await documentProcessorServiceClient.CreateProcessorAsync(parent, processor);
CreateProcessorAsync(String, Processor, CancellationToken)
public virtual Task<Processor> CreateProcessorAsync(string parent, Processor processor, CancellationToken cancellationToken)
Creates a processor from the type processor that the user chose. The processor will be at "ENABLED" state by default after its creation.
Parameters | |
---|---|
Name | Description |
parent | String Required. The parent (project and location) under which to create the processor. Format: projects/{project}/locations/{location} |
processor | Processor Required. The processor to be created, requires [processor_type] and [display_name] to be set. Also, the processor is under CMEK if CMEK fields are set. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Processor> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Processor processor = new Processor();
// Make the request
Processor response = await documentProcessorServiceClient.CreateProcessorAsync(parent, processor);
DeleteProcessor(DeleteProcessorRequest, CallSettings)
public virtual Operation<Empty, DeleteProcessorMetadata> DeleteProcessor(DeleteProcessorRequest request, CallSettings callSettings = null)
Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes all artifacts associated with this processor.
Parameters | |
---|---|
Name | Description |
request | DeleteProcessorRequest 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<Empty, DeleteProcessorMetadata> | The RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.Create();
// Initialize request argument(s)
DeleteProcessorRequest request = new DeleteProcessorRequest
{
ProcessorName = ProcessorName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"),
};
// Make the request
Operation<Empty, DeleteProcessorMetadata> response = documentProcessorServiceClient.DeleteProcessor(request);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteProcessorMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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<Empty, DeleteProcessorMetadata> retrievedResponse = documentProcessorServiceClient.PollOnceDeleteProcessor(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteProcessor(ProcessorName, CallSettings)
public virtual Operation<Empty, DeleteProcessorMetadata> DeleteProcessor(ProcessorName name, CallSettings callSettings = null)
Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes all artifacts associated with this processor.
Parameters | |
---|---|
Name | Description |
name | ProcessorName Required. The processor resource name to be deleted. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Empty, DeleteProcessorMetadata> | The RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.Create();
// Initialize request argument(s)
ProcessorName name = ProcessorName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
// Make the request
Operation<Empty, DeleteProcessorMetadata> response = documentProcessorServiceClient.DeleteProcessor(name);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteProcessorMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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<Empty, DeleteProcessorMetadata> retrievedResponse = documentProcessorServiceClient.PollOnceDeleteProcessor(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteProcessor(String, CallSettings)
public virtual Operation<Empty, DeleteProcessorMetadata> DeleteProcessor(string name, CallSettings callSettings = null)
Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes all artifacts associated with this processor.
Parameters | |
---|---|
Name | Description |
name | String Required. The processor resource name to be deleted. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Empty, DeleteProcessorMetadata> | 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<Empty, DeleteProcessorMetadata> response = documentProcessorServiceClient.DeleteProcessor(name);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteProcessorMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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<Empty, DeleteProcessorMetadata> retrievedResponse = documentProcessorServiceClient.PollOnceDeleteProcessor(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteProcessorAsync(DeleteProcessorRequest, CallSettings)
public virtual Task<Operation<Empty, DeleteProcessorMetadata>> DeleteProcessorAsync(DeleteProcessorRequest request, CallSettings callSettings = null)
Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes all artifacts associated with this processor.
Parameters | |
---|---|
Name | Description |
request | DeleteProcessorRequest 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<Empty, DeleteProcessorMetadata>> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteProcessorRequest request = new DeleteProcessorRequest
{
ProcessorName = ProcessorName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"),
};
// Make the request
Operation<Empty, DeleteProcessorMetadata> response = await documentProcessorServiceClient.DeleteProcessorAsync(request);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteProcessorMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, DeleteProcessorMetadata> retrievedResponse = await documentProcessorServiceClient.PollOnceDeleteProcessorAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteProcessorAsync(DeleteProcessorRequest, CancellationToken)
public virtual Task<Operation<Empty, DeleteProcessorMetadata>> DeleteProcessorAsync(DeleteProcessorRequest request, CancellationToken cancellationToken)
Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes all artifacts associated with this processor.
Parameters | |
---|---|
Name | Description |
request | DeleteProcessorRequest 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<Empty, DeleteProcessorMetadata>> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteProcessorRequest request = new DeleteProcessorRequest
{
ProcessorName = ProcessorName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"),
};
// Make the request
Operation<Empty, DeleteProcessorMetadata> response = await documentProcessorServiceClient.DeleteProcessorAsync(request);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteProcessorMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, DeleteProcessorMetadata> retrievedResponse = await documentProcessorServiceClient.PollOnceDeleteProcessorAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteProcessorAsync(ProcessorName, CallSettings)
public virtual Task<Operation<Empty, DeleteProcessorMetadata>> DeleteProcessorAsync(ProcessorName name, CallSettings callSettings = null)
Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes all artifacts associated with this processor.
Parameters | |
---|---|
Name | Description |
name | ProcessorName Required. The processor resource name to be deleted. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Empty, DeleteProcessorMetadata>> | 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<Empty, DeleteProcessorMetadata> response = await documentProcessorServiceClient.DeleteProcessorAsync(name);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteProcessorMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, DeleteProcessorMetadata> retrievedResponse = await documentProcessorServiceClient.PollOnceDeleteProcessorAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteProcessorAsync(ProcessorName, CancellationToken)
public virtual Task<Operation<Empty, DeleteProcessorMetadata>> DeleteProcessorAsync(ProcessorName name, CancellationToken cancellationToken)
Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes all artifacts associated with this processor.
Parameters | |
---|---|
Name | Description |
name | ProcessorName Required. The processor resource name to be deleted. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Empty, DeleteProcessorMetadata>> | 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<Empty, DeleteProcessorMetadata> response = await documentProcessorServiceClient.DeleteProcessorAsync(name);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteProcessorMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, DeleteProcessorMetadata> retrievedResponse = await documentProcessorServiceClient.PollOnceDeleteProcessorAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteProcessorAsync(String, CallSettings)
public virtual Task<Operation<Empty, DeleteProcessorMetadata>> DeleteProcessorAsync(string name, CallSettings callSettings = null)
Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes all artifacts associated with this processor.
Parameters | |
---|---|
Name | Description |
name | String Required. The processor resource name to be deleted. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Empty, DeleteProcessorMetadata>> | 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<Empty, DeleteProcessorMetadata> response = await documentProcessorServiceClient.DeleteProcessorAsync(name);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteProcessorMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, DeleteProcessorMetadata> retrievedResponse = await documentProcessorServiceClient.PollOnceDeleteProcessorAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteProcessorAsync(String, CancellationToken)
public virtual Task<Operation<Empty, DeleteProcessorMetadata>> DeleteProcessorAsync(string name, CancellationToken cancellationToken)
Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes all artifacts associated with this processor.
Parameters | |
---|---|
Name | Description |
name | String Required. The processor resource name to be deleted. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Empty, DeleteProcessorMetadata>> | 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<Empty, DeleteProcessorMetadata> response = await documentProcessorServiceClient.DeleteProcessorAsync(name);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteProcessorMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, DeleteProcessorMetadata> retrievedResponse = await documentProcessorServiceClient.PollOnceDeleteProcessorAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DisableProcessor(DisableProcessorRequest, CallSettings)
public virtual Operation<DisableProcessorResponse, DisableProcessorMetadata> DisableProcessor(DisableProcessorRequest request, CallSettings callSettings = null)
Disables a processor
Parameters | |
---|---|
Name | Description |
request | DisableProcessorRequest 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<DisableProcessorResponse, DisableProcessorMetadata> | The RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.Create();
// Initialize request argument(s)
DisableProcessorRequest request = new DisableProcessorRequest
{
ProcessorName = ProcessorName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"),
};
// Make the request
Operation<DisableProcessorResponse, DisableProcessorMetadata> response = documentProcessorServiceClient.DisableProcessor(request);
// Poll until the returned long-running operation is complete
Operation<DisableProcessorResponse, DisableProcessorMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
DisableProcessorResponse 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<DisableProcessorResponse, DisableProcessorMetadata> retrievedResponse = documentProcessorServiceClient.PollOnceDisableProcessor(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
DisableProcessorResponse retrievedResult = retrievedResponse.Result;
}
DisableProcessorAsync(DisableProcessorRequest, CallSettings)
public virtual Task<Operation<DisableProcessorResponse, DisableProcessorMetadata>> DisableProcessorAsync(DisableProcessorRequest request, CallSettings callSettings = null)
Disables a processor
Parameters | |
---|---|
Name | Description |
request | DisableProcessorRequest 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<DisableProcessorResponse, DisableProcessorMetadata>> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
DisableProcessorRequest request = new DisableProcessorRequest
{
ProcessorName = ProcessorName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"),
};
// Make the request
Operation<DisableProcessorResponse, DisableProcessorMetadata> response = await documentProcessorServiceClient.DisableProcessorAsync(request);
// Poll until the returned long-running operation is complete
Operation<DisableProcessorResponse, DisableProcessorMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
DisableProcessorResponse 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<DisableProcessorResponse, DisableProcessorMetadata> retrievedResponse = await documentProcessorServiceClient.PollOnceDisableProcessorAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
DisableProcessorResponse retrievedResult = retrievedResponse.Result;
}
DisableProcessorAsync(DisableProcessorRequest, CancellationToken)
public virtual Task<Operation<DisableProcessorResponse, DisableProcessorMetadata>> DisableProcessorAsync(DisableProcessorRequest request, CancellationToken cancellationToken)
Disables a processor
Parameters | |
---|---|
Name | Description |
request | DisableProcessorRequest 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<DisableProcessorResponse, DisableProcessorMetadata>> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
DisableProcessorRequest request = new DisableProcessorRequest
{
ProcessorName = ProcessorName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"),
};
// Make the request
Operation<DisableProcessorResponse, DisableProcessorMetadata> response = await documentProcessorServiceClient.DisableProcessorAsync(request);
// Poll until the returned long-running operation is complete
Operation<DisableProcessorResponse, DisableProcessorMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
DisableProcessorResponse 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<DisableProcessorResponse, DisableProcessorMetadata> retrievedResponse = await documentProcessorServiceClient.PollOnceDisableProcessorAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
DisableProcessorResponse retrievedResult = retrievedResponse.Result;
}
EnableProcessor(EnableProcessorRequest, CallSettings)
public virtual Operation<EnableProcessorResponse, EnableProcessorMetadata> EnableProcessor(EnableProcessorRequest request, CallSettings callSettings = null)
Enables a processor
Parameters | |
---|---|
Name | Description |
request | EnableProcessorRequest 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<EnableProcessorResponse, EnableProcessorMetadata> | The RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.Create();
// Initialize request argument(s)
EnableProcessorRequest request = new EnableProcessorRequest
{
ProcessorName = ProcessorName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"),
};
// Make the request
Operation<EnableProcessorResponse, EnableProcessorMetadata> response = documentProcessorServiceClient.EnableProcessor(request);
// Poll until the returned long-running operation is complete
Operation<EnableProcessorResponse, EnableProcessorMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
EnableProcessorResponse 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<EnableProcessorResponse, EnableProcessorMetadata> retrievedResponse = documentProcessorServiceClient.PollOnceEnableProcessor(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
EnableProcessorResponse retrievedResult = retrievedResponse.Result;
}
EnableProcessorAsync(EnableProcessorRequest, CallSettings)
public virtual Task<Operation<EnableProcessorResponse, EnableProcessorMetadata>> EnableProcessorAsync(EnableProcessorRequest request, CallSettings callSettings = null)
Enables a processor
Parameters | |
---|---|
Name | Description |
request | EnableProcessorRequest 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<EnableProcessorResponse, EnableProcessorMetadata>> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
EnableProcessorRequest request = new EnableProcessorRequest
{
ProcessorName = ProcessorName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"),
};
// Make the request
Operation<EnableProcessorResponse, EnableProcessorMetadata> response = await documentProcessorServiceClient.EnableProcessorAsync(request);
// Poll until the returned long-running operation is complete
Operation<EnableProcessorResponse, EnableProcessorMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
EnableProcessorResponse 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<EnableProcessorResponse, EnableProcessorMetadata> retrievedResponse = await documentProcessorServiceClient.PollOnceEnableProcessorAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
EnableProcessorResponse retrievedResult = retrievedResponse.Result;
}
EnableProcessorAsync(EnableProcessorRequest, CancellationToken)
public virtual Task<Operation<EnableProcessorResponse, EnableProcessorMetadata>> EnableProcessorAsync(EnableProcessorRequest request, CancellationToken cancellationToken)
Enables a processor
Parameters | |
---|---|
Name | Description |
request | EnableProcessorRequest 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<EnableProcessorResponse, EnableProcessorMetadata>> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
EnableProcessorRequest request = new EnableProcessorRequest
{
ProcessorName = ProcessorName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"),
};
// Make the request
Operation<EnableProcessorResponse, EnableProcessorMetadata> response = await documentProcessorServiceClient.EnableProcessorAsync(request);
// Poll until the returned long-running operation is complete
Operation<EnableProcessorResponse, EnableProcessorMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
EnableProcessorResponse 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<EnableProcessorResponse, EnableProcessorMetadata> retrievedResponse = await documentProcessorServiceClient.PollOnceEnableProcessorAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
EnableProcessorResponse retrievedResult = retrievedResponse.Result;
}
FetchProcessorTypes(LocationName, CallSettings)
public virtual FetchProcessorTypesResponse FetchProcessorTypes(LocationName parent, CallSettings callSettings = null)
Fetches processor types.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The project of processor type to list. Format: projects/{project}/locations/{location} |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
FetchProcessorTypesResponse | The RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
FetchProcessorTypesResponse response = documentProcessorServiceClient.FetchProcessorTypes(parent);
FetchProcessorTypes(FetchProcessorTypesRequest, CallSettings)
public virtual FetchProcessorTypesResponse FetchProcessorTypes(FetchProcessorTypesRequest request, CallSettings callSettings = null)
Fetches processor types.
Parameters | |
---|---|
Name | Description |
request | FetchProcessorTypesRequest 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 |
FetchProcessorTypesResponse | The RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.Create();
// Initialize request argument(s)
FetchProcessorTypesRequest request = new FetchProcessorTypesRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
FetchProcessorTypesResponse response = documentProcessorServiceClient.FetchProcessorTypes(request);
FetchProcessorTypes(String, CallSettings)
public virtual FetchProcessorTypesResponse FetchProcessorTypes(string parent, CallSettings callSettings = null)
Fetches processor types.
Parameters | |
---|---|
Name | Description |
parent | String Required. The project of processor type to list. Format: projects/{project}/locations/{location} |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
FetchProcessorTypesResponse | The RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
FetchProcessorTypesResponse response = documentProcessorServiceClient.FetchProcessorTypes(parent);
FetchProcessorTypesAsync(LocationName, CallSettings)
public virtual Task<FetchProcessorTypesResponse> FetchProcessorTypesAsync(LocationName parent, CallSettings callSettings = null)
Fetches processor types.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The project of processor type to list. Format: projects/{project}/locations/{location} |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<FetchProcessorTypesResponse> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
FetchProcessorTypesResponse response = await documentProcessorServiceClient.FetchProcessorTypesAsync(parent);
FetchProcessorTypesAsync(LocationName, CancellationToken)
public virtual Task<FetchProcessorTypesResponse> FetchProcessorTypesAsync(LocationName parent, CancellationToken cancellationToken)
Fetches processor types.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The project of processor type to list. Format: projects/{project}/locations/{location} |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<FetchProcessorTypesResponse> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
FetchProcessorTypesResponse response = await documentProcessorServiceClient.FetchProcessorTypesAsync(parent);
FetchProcessorTypesAsync(FetchProcessorTypesRequest, CallSettings)
public virtual Task<FetchProcessorTypesResponse> FetchProcessorTypesAsync(FetchProcessorTypesRequest request, CallSettings callSettings = null)
Fetches processor types.
Parameters | |
---|---|
Name | Description |
request | FetchProcessorTypesRequest 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<FetchProcessorTypesResponse> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
FetchProcessorTypesRequest request = new FetchProcessorTypesRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
FetchProcessorTypesResponse response = await documentProcessorServiceClient.FetchProcessorTypesAsync(request);
FetchProcessorTypesAsync(FetchProcessorTypesRequest, CancellationToken)
public virtual Task<FetchProcessorTypesResponse> FetchProcessorTypesAsync(FetchProcessorTypesRequest request, CancellationToken cancellationToken)
Fetches processor types.
Parameters | |
---|---|
Name | Description |
request | FetchProcessorTypesRequest 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<FetchProcessorTypesResponse> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
FetchProcessorTypesRequest request = new FetchProcessorTypesRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
FetchProcessorTypesResponse response = await documentProcessorServiceClient.FetchProcessorTypesAsync(request);
FetchProcessorTypesAsync(String, CallSettings)
public virtual Task<FetchProcessorTypesResponse> FetchProcessorTypesAsync(string parent, CallSettings callSettings = null)
Fetches processor types.
Parameters | |
---|---|
Name | Description |
parent | String Required. The project of processor type to list. Format: projects/{project}/locations/{location} |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<FetchProcessorTypesResponse> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
FetchProcessorTypesResponse response = await documentProcessorServiceClient.FetchProcessorTypesAsync(parent);
FetchProcessorTypesAsync(String, CancellationToken)
public virtual Task<FetchProcessorTypesResponse> FetchProcessorTypesAsync(string parent, CancellationToken cancellationToken)
Fetches processor types.
Parameters | |
---|---|
Name | Description |
parent | String Required. The project of processor type to list. Format: projects/{project}/locations/{location} |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<FetchProcessorTypesResponse> | A Task containing the RPC response. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
FetchProcessorTypesResponse response = await documentProcessorServiceClient.FetchProcessorTypesAsync(parent);
ListProcessors(LocationName, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListProcessorsResponse, Processor> ListProcessors(LocationName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)
Lists all processors which belong to this project.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The parent (project and location) which owns this collection of Processors. Format: projects/{project}/locations/{location} |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListProcessorsResponse, Processor> | A pageable sequence of Processor resources. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListProcessorsResponse, Processor> response = documentProcessorServiceClient.ListProcessors(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Processor item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListProcessorsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Processor item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Processor> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Processor item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListProcessors(ListProcessorsRequest, CallSettings)
public virtual PagedEnumerable<ListProcessorsResponse, Processor> ListProcessors(ListProcessorsRequest request, CallSettings callSettings = null)
Lists all processors which belong to this project.
Parameters | |
---|---|
Name | Description |
request | ListProcessorsRequest 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 |
PagedEnumerable<ListProcessorsResponse, Processor> | A pageable sequence of Processor resources. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.Create();
// Initialize request argument(s)
ListProcessorsRequest request = new ListProcessorsRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
PagedEnumerable<ListProcessorsResponse, Processor> response = documentProcessorServiceClient.ListProcessors(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (Processor item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListProcessorsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Processor item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Processor> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Processor item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListProcessors(String, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListProcessorsResponse, Processor> ListProcessors(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)
Lists all processors which belong to this project.
Parameters | |
---|---|
Name | Description |
parent | String Required. The parent (project and location) which owns this collection of Processors. Format: projects/{project}/locations/{location} |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListProcessorsResponse, Processor> | A pageable sequence of Processor resources. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListProcessorsResponse, Processor> response = documentProcessorServiceClient.ListProcessors(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Processor item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListProcessorsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Processor item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Processor> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Processor item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListProcessorsAsync(LocationName, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListProcessorsResponse, Processor> ListProcessorsAsync(LocationName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)
Lists all processors which belong to this project.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The parent (project and location) which owns this collection of Processors. Format: projects/{project}/locations/{location} |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListProcessorsResponse, Processor> | A pageable asynchronous sequence of Processor resources. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListProcessorsResponse, Processor> response = documentProcessorServiceClient.ListProcessorsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Processor item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListProcessorsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Processor item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Processor> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Processor item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListProcessorsAsync(ListProcessorsRequest, CallSettings)
public virtual PagedAsyncEnumerable<ListProcessorsResponse, Processor> ListProcessorsAsync(ListProcessorsRequest request, CallSettings callSettings = null)
Lists all processors which belong to this project.
Parameters | |
---|---|
Name | Description |
request | ListProcessorsRequest 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 |
PagedAsyncEnumerable<ListProcessorsResponse, Processor> | A pageable asynchronous sequence of Processor resources. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
ListProcessorsRequest request = new ListProcessorsRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
PagedAsyncEnumerable<ListProcessorsResponse, Processor> response = documentProcessorServiceClient.ListProcessorsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Processor item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListProcessorsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Processor item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Processor> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Processor item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListProcessorsAsync(String, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListProcessorsResponse, Processor> ListProcessorsAsync(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)
Lists all processors which belong to this project.
Parameters | |
---|---|
Name | Description |
parent | String Required. The parent (project and location) which owns this collection of Processors. Format: projects/{project}/locations/{location} |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListProcessorsResponse, Processor> | A pageable asynchronous sequence of Processor resources. |
// Create client
DocumentProcessorServiceClient documentProcessorServiceClient = await DocumentProcessorServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListProcessorsResponse, Processor> response = documentProcessorServiceClient.ListProcessorsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Processor item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListProcessorsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Processor item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Processor> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Processor item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
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. |
PollOnceDeleteProcessor(String, CallSettings)
public virtual Operation<Empty, DeleteProcessorMetadata> PollOnceDeleteProcessor(string operationName, CallSettings callSettings = null)
Poll an operation once, using an operationName
from a previous invocation of DeleteProcessor
.
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<Empty, DeleteProcessorMetadata> | The result of polling the operation. |
PollOnceDeleteProcessorAsync(String, CallSettings)
public virtual Task<Operation<Empty, DeleteProcessorMetadata>> PollOnceDeleteProcessorAsync(string operationName, CallSettings callSettings = null)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
DeleteProcessor
.
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<Empty, DeleteProcessorMetadata>> | A task representing the result of polling the operation. |
PollOnceDisableProcessor(String, CallSettings)
public virtual Operation<DisableProcessorResponse, DisableProcessorMetadata> PollOnceDisableProcessor(string operationName, CallSettings callSettings = null)
Poll an operation once, using an operationName
from a previous invocation of DisableProcessor
.
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<DisableProcessorResponse, DisableProcessorMetadata> | The result of polling the operation. |
PollOnceDisableProcessorAsync(String, CallSettings)
public virtual Task<Operation<DisableProcessorResponse, DisableProcessorMetadata>> PollOnceDisableProcessorAsync(string operationName, CallSettings callSettings = null)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
DisableProcessor
.
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<DisableProcessorResponse, DisableProcessorMetadata>> | A task representing the result of polling the operation. |
PollOnceEnableProcessor(String, CallSettings)
public virtual Operation<EnableProcessorResponse, EnableProcessorMetadata> PollOnceEnableProcessor(string operationName, CallSettings callSettings = null)
Poll an operation once, using an operationName
from a previous invocation of EnableProcessor
.
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<EnableProcessorResponse, EnableProcessorMetadata> | The result of polling the operation. |
PollOnceEnableProcessorAsync(String, CallSettings)
public virtual Task<Operation<EnableProcessorResponse, EnableProcessorMetadata>> PollOnceEnableProcessorAsync(string operationName, CallSettings callSettings = null)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
EnableProcessor
.
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<EnableProcessorResponse, EnableProcessorMetadata>> | 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.