Struct google_api_proto::google::cloud::documentai::v1::document_processor_service_client::DocumentProcessorServiceClient
source · pub struct DocumentProcessorServiceClient<T> { /* private fields */ }
Expand description
Service to call Document AI 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.
Implementations§
source§impl<T> DocumentProcessorServiceClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> DocumentProcessorServiceClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>(
inner: T,
interceptor: F
) -> DocumentProcessorServiceClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>,
<T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,
sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
sourcepub fn max_decoding_message_size(self, limit: usize) -> Self
pub fn max_decoding_message_size(self, limit: usize) -> Self
Limits the maximum size of a decoded message.
Default: 4MB
sourcepub fn max_encoding_message_size(self, limit: usize) -> Self
pub fn max_encoding_message_size(self, limit: usize) -> Self
Limits the maximum size of an encoded message.
Default: usize::MAX
sourcepub async fn process_document(
&mut self,
request: impl IntoRequest<ProcessRequest>
) -> Result<Response<ProcessResponse>, Status>
pub async fn process_document( &mut self, request: impl IntoRequest<ProcessRequest> ) -> Result<Response<ProcessResponse>, Status>
Processes a single document.
sourcepub async fn batch_process_documents(
&mut self,
request: impl IntoRequest<BatchProcessRequest>
) -> Result<Response<Operation>, Status>
pub async fn batch_process_documents( &mut self, request: impl IntoRequest<BatchProcessRequest> ) -> Result<Response<Operation>, Status>
LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.
sourcepub async fn fetch_processor_types(
&mut self,
request: impl IntoRequest<FetchProcessorTypesRequest>
) -> Result<Response<FetchProcessorTypesResponse>, Status>
pub async fn fetch_processor_types( &mut self, request: impl IntoRequest<FetchProcessorTypesRequest> ) -> Result<Response<FetchProcessorTypesResponse>, Status>
Fetches processor types. Note that we don’t use [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] here, because it isn’t paginated.
sourcepub async fn list_processor_types(
&mut self,
request: impl IntoRequest<ListProcessorTypesRequest>
) -> Result<Response<ListProcessorTypesResponse>, Status>
pub async fn list_processor_types( &mut self, request: impl IntoRequest<ListProcessorTypesRequest> ) -> Result<Response<ListProcessorTypesResponse>, Status>
Lists the processor types that exist.
sourcepub async fn get_processor_type(
&mut self,
request: impl IntoRequest<GetProcessorTypeRequest>
) -> Result<Response<ProcessorType>, Status>
pub async fn get_processor_type( &mut self, request: impl IntoRequest<GetProcessorTypeRequest> ) -> Result<Response<ProcessorType>, Status>
Gets a processor type detail.
sourcepub async fn list_processors(
&mut self,
request: impl IntoRequest<ListProcessorsRequest>
) -> Result<Response<ListProcessorsResponse>, Status>
pub async fn list_processors( &mut self, request: impl IntoRequest<ListProcessorsRequest> ) -> Result<Response<ListProcessorsResponse>, Status>
Lists all processors which belong to this project.
sourcepub async fn get_processor(
&mut self,
request: impl IntoRequest<GetProcessorRequest>
) -> Result<Response<Processor>, Status>
pub async fn get_processor( &mut self, request: impl IntoRequest<GetProcessorRequest> ) -> Result<Response<Processor>, Status>
Gets a processor detail.
sourcepub async fn train_processor_version(
&mut self,
request: impl IntoRequest<TrainProcessorVersionRequest>
) -> Result<Response<Operation>, Status>
pub async fn train_processor_version( &mut self, request: impl IntoRequest<TrainProcessorVersionRequest> ) -> Result<Response<Operation>, Status>
Trains a new processor version. Operation metadata is returned as [TrainProcessorVersionMetadata][google.cloud.documentai.v1.TrainProcessorVersionMetadata].
sourcepub async fn get_processor_version(
&mut self,
request: impl IntoRequest<GetProcessorVersionRequest>
) -> Result<Response<ProcessorVersion>, Status>
pub async fn get_processor_version( &mut self, request: impl IntoRequest<GetProcessorVersionRequest> ) -> Result<Response<ProcessorVersion>, Status>
Gets a processor version detail.
sourcepub async fn list_processor_versions(
&mut self,
request: impl IntoRequest<ListProcessorVersionsRequest>
) -> Result<Response<ListProcessorVersionsResponse>, Status>
pub async fn list_processor_versions( &mut self, request: impl IntoRequest<ListProcessorVersionsRequest> ) -> Result<Response<ListProcessorVersionsResponse>, Status>
Lists all versions of a processor.
sourcepub async fn delete_processor_version(
&mut self,
request: impl IntoRequest<DeleteProcessorVersionRequest>
) -> Result<Response<Operation>, Status>
pub async fn delete_processor_version( &mut self, request: impl IntoRequest<DeleteProcessorVersionRequest> ) -> Result<Response<Operation>, Status>
Deletes the processor version, all artifacts under the processor version will be deleted.
sourcepub async fn deploy_processor_version(
&mut self,
request: impl IntoRequest<DeployProcessorVersionRequest>
) -> Result<Response<Operation>, Status>
pub async fn deploy_processor_version( &mut self, request: impl IntoRequest<DeployProcessorVersionRequest> ) -> Result<Response<Operation>, Status>
Deploys the processor version.
sourcepub async fn undeploy_processor_version(
&mut self,
request: impl IntoRequest<UndeployProcessorVersionRequest>
) -> Result<Response<Operation>, Status>
pub async fn undeploy_processor_version( &mut self, request: impl IntoRequest<UndeployProcessorVersionRequest> ) -> Result<Response<Operation>, Status>
Undeploys the processor version.
sourcepub async fn create_processor(
&mut self,
request: impl IntoRequest<CreateProcessorRequest>
) -> Result<Response<Processor>, Status>
pub async fn create_processor( &mut self, request: impl IntoRequest<CreateProcessorRequest> ) -> Result<Response<Processor>, Status>
Creates a processor from the [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided.
The processor will be at ENABLED
state by default after its creation.
sourcepub async fn delete_processor(
&mut self,
request: impl IntoRequest<DeleteProcessorRequest>
) -> Result<Response<Operation>, Status>
pub async fn delete_processor( &mut self, request: impl IntoRequest<DeleteProcessorRequest> ) -> Result<Response<Operation>, Status>
Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes all artifacts associated with this processor.
sourcepub async fn enable_processor(
&mut self,
request: impl IntoRequest<EnableProcessorRequest>
) -> Result<Response<Operation>, Status>
pub async fn enable_processor( &mut self, request: impl IntoRequest<EnableProcessorRequest> ) -> Result<Response<Operation>, Status>
Enables a processor
sourcepub async fn disable_processor(
&mut self,
request: impl IntoRequest<DisableProcessorRequest>
) -> Result<Response<Operation>, Status>
pub async fn disable_processor( &mut self, request: impl IntoRequest<DisableProcessorRequest> ) -> Result<Response<Operation>, Status>
Disables a processor
sourcepub async fn set_default_processor_version(
&mut self,
request: impl IntoRequest<SetDefaultProcessorVersionRequest>
) -> Result<Response<Operation>, Status>
pub async fn set_default_processor_version( &mut self, request: impl IntoRequest<SetDefaultProcessorVersionRequest> ) -> Result<Response<Operation>, Status>
Set the default (active) version of a [Processor][google.cloud.documentai.v1.Processor] that will be used in [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] and [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
sourcepub async fn review_document(
&mut self,
request: impl IntoRequest<ReviewDocumentRequest>
) -> Result<Response<Operation>, Status>
pub async fn review_document( &mut self, request: impl IntoRequest<ReviewDocumentRequest> ) -> Result<Response<Operation>, Status>
Send a document for Human Review. The input document should be processed by the specified processor.
sourcepub async fn evaluate_processor_version(
&mut self,
request: impl IntoRequest<EvaluateProcessorVersionRequest>
) -> Result<Response<Operation>, Status>
pub async fn evaluate_processor_version( &mut self, request: impl IntoRequest<EvaluateProcessorVersionRequest> ) -> Result<Response<Operation>, Status>
Evaluates a ProcessorVersion against annotated documents, producing an Evaluation.
sourcepub async fn get_evaluation(
&mut self,
request: impl IntoRequest<GetEvaluationRequest>
) -> Result<Response<Evaluation>, Status>
pub async fn get_evaluation( &mut self, request: impl IntoRequest<GetEvaluationRequest> ) -> Result<Response<Evaluation>, Status>
Retrieves a specific evaluation.
sourcepub async fn list_evaluations(
&mut self,
request: impl IntoRequest<ListEvaluationsRequest>
) -> Result<Response<ListEvaluationsResponse>, Status>
pub async fn list_evaluations( &mut self, request: impl IntoRequest<ListEvaluationsRequest> ) -> Result<Response<ListEvaluationsResponse>, Status>
Retrieves a set of evaluations for a given processor version.
Trait Implementations§
source§impl<T: Clone> Clone for DocumentProcessorServiceClient<T>
impl<T: Clone> Clone for DocumentProcessorServiceClient<T>
source§fn clone(&self) -> DocumentProcessorServiceClient<T>
fn clone(&self) -> DocumentProcessorServiceClient<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<T> !Freeze for DocumentProcessorServiceClient<T>
impl<T> RefUnwindSafe for DocumentProcessorServiceClient<T>where
T: RefUnwindSafe,
impl<T> Send for DocumentProcessorServiceClient<T>where
T: Send,
impl<T> Sync for DocumentProcessorServiceClient<T>where
T: Sync,
impl<T> Unpin for DocumentProcessorServiceClient<T>where
T: Unpin,
impl<T> UnwindSafe for DocumentProcessorServiceClient<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request