pub struct ProjectMethods<'a, C>where
C: 'a,{ /* private fields */ }Expand description
A builder providing access to all methods supported on project resources.
It is not used directly, but through the Document hub.
§Example
Instantiate a resource builder
extern crate hyper;
extern crate hyper_rustls;
extern crate google_documentai1 as documentai1;
use documentai1::{Document, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
let secret: yup_oauth2::ApplicationSecret = Default::default();
let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
secret,
yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
).build().await.unwrap();
let client = hyper_util::client::legacy::Client::builder(
hyper_util::rt::TokioExecutor::new()
)
.build(
hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.unwrap()
.https_or_http()
.enable_http1()
.build()
);
let mut hub = Document::new(client, auth);
// Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
// like `locations_fetch_processor_types(...)`, `locations_get(...)`, `locations_list(...)`, `locations_operations_cancel(...)`, `locations_operations_get(...)`, `locations_operations_list(...)`, `locations_processor_types_get(...)`, `locations_processor_types_list(...)`, `locations_processors_batch_process(...)`, `locations_processors_create(...)`, `locations_processors_delete(...)`, `locations_processors_disable(...)`, `locations_processors_enable(...)`, `locations_processors_get(...)`, `locations_processors_human_review_config_review_document(...)`, `locations_processors_list(...)`, `locations_processors_process(...)`, `locations_processors_processor_versions_batch_process(...)`, `locations_processors_processor_versions_delete(...)`, `locations_processors_processor_versions_deploy(...)`, `locations_processors_processor_versions_evaluate_processor_version(...)`, `locations_processors_processor_versions_evaluations_get(...)`, `locations_processors_processor_versions_evaluations_list(...)`, `locations_processors_processor_versions_get(...)`, `locations_processors_processor_versions_list(...)`, `locations_processors_processor_versions_process(...)`, `locations_processors_processor_versions_train(...)`, `locations_processors_processor_versions_undeploy(...)`, `locations_processors_set_default_processor_version(...)` and `operations_get(...)`
// to build up your call.
let rb = hub.projects();Implementations§
Source§impl<'a, C> ProjectMethods<'a, C>
impl<'a, C> ProjectMethods<'a, C>
Sourcepub fn locations_operations_cancel(
&self,
name: &str,
) -> ProjectLocationOperationCancelCall<'a, C>
pub fn locations_operations_cancel( &self, name: &str, ) -> ProjectLocationOperationCancelCall<'a, C>
Create a builder to help you perform the following task:
Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn’t support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.
§Arguments
name- The name of the operation resource to be cancelled.
Sourcepub fn locations_operations_get(
&self,
name: &str,
) -> ProjectLocationOperationGetCall<'a, C>
pub fn locations_operations_get( &self, name: &str, ) -> ProjectLocationOperationGetCall<'a, C>
Create a builder to help you perform the following task:
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
§Arguments
name- The name of the operation resource.
Sourcepub fn locations_operations_list(
&self,
name: &str,
) -> ProjectLocationOperationListCall<'a, C>
pub fn locations_operations_list( &self, name: &str, ) -> ProjectLocationOperationListCall<'a, C>
Create a builder to help you perform the following task:
Lists operations that match the specified filter in the request. If the server doesn’t support this method, it returns UNIMPLEMENTED.
§Arguments
name- The name of the operation’s parent resource.
Sourcepub fn locations_processor_types_get(
&self,
name: &str,
) -> ProjectLocationProcessorTypeGetCall<'a, C>
pub fn locations_processor_types_get( &self, name: &str, ) -> ProjectLocationProcessorTypeGetCall<'a, C>
Create a builder to help you perform the following task:
Gets a processor type detail.
§Arguments
name- Required. The processor type resource name.
Sourcepub fn locations_processor_types_list(
&self,
parent: &str,
) -> ProjectLocationProcessorTypeListCall<'a, C>
pub fn locations_processor_types_list( &self, parent: &str, ) -> ProjectLocationProcessorTypeListCall<'a, C>
Create a builder to help you perform the following task:
Lists the processor types that exist.
§Arguments
parent- Required. The location of processor types to list. Format:projects/{project}/locations/{location}.
Sourcepub fn locations_processors_human_review_config_review_document(
&self,
request: GoogleCloudDocumentaiV1ReviewDocumentRequest,
human_review_config: &str,
) -> ProjectLocationProcessorHumanReviewConfigReviewDocumentCall<'a, C>
pub fn locations_processors_human_review_config_review_document( &self, request: GoogleCloudDocumentaiV1ReviewDocumentRequest, human_review_config: &str, ) -> ProjectLocationProcessorHumanReviewConfigReviewDocumentCall<'a, C>
Create a builder to help you perform the following task:
Send a document for Human Review. The input document should be processed by the specified processor.
§Arguments
request- No description provided.humanReviewConfig- Required. The resource name of the HumanReviewConfig that the document will be reviewed with.
Sourcepub fn locations_processors_processor_versions_evaluations_get(
&self,
name: &str,
) -> ProjectLocationProcessorProcessorVersionEvaluationGetCall<'a, C>
pub fn locations_processors_processor_versions_evaluations_get( &self, name: &str, ) -> ProjectLocationProcessorProcessorVersionEvaluationGetCall<'a, C>
Create a builder to help you perform the following task:
Retrieves a specific evaluation.
§Arguments
name- Required. The resource name of the Evaluation to get.projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}
Sourcepub fn locations_processors_processor_versions_evaluations_list(
&self,
parent: &str,
) -> ProjectLocationProcessorProcessorVersionEvaluationListCall<'a, C>
pub fn locations_processors_processor_versions_evaluations_list( &self, parent: &str, ) -> ProjectLocationProcessorProcessorVersionEvaluationListCall<'a, C>
Create a builder to help you perform the following task:
Retrieves a set of evaluations for a given processor version.
§Arguments
parent- Required. The resource name of the ProcessorVersion to list evaluations for.projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}
Sourcepub fn locations_processors_processor_versions_batch_process(
&self,
request: GoogleCloudDocumentaiV1BatchProcessRequest,
name: &str,
) -> ProjectLocationProcessorProcessorVersionBatchProcesCall<'a, C>
pub fn locations_processors_processor_versions_batch_process( &self, request: GoogleCloudDocumentaiV1BatchProcessRequest, name: &str, ) -> ProjectLocationProcessorProcessorVersionBatchProcesCall<'a, C>
Create a builder to help you perform the following task:
LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the Document format.
§Arguments
request- No description provided.name- Required. The resource name of Processor or ProcessorVersion. Format:projects/{project}/locations/{location}/processors/{processor}, orprojects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}
Sourcepub fn locations_processors_processor_versions_delete(
&self,
name: &str,
) -> ProjectLocationProcessorProcessorVersionDeleteCall<'a, C>
pub fn locations_processors_processor_versions_delete( &self, name: &str, ) -> ProjectLocationProcessorProcessorVersionDeleteCall<'a, C>
Create a builder to help you perform the following task:
Deletes the processor version, all artifacts under the processor version will be deleted.
§Arguments
name- Required. The processor version resource name to be deleted.
Sourcepub fn locations_processors_processor_versions_deploy(
&self,
request: GoogleCloudDocumentaiV1DeployProcessorVersionRequest,
name: &str,
) -> ProjectLocationProcessorProcessorVersionDeployCall<'a, C>
pub fn locations_processors_processor_versions_deploy( &self, request: GoogleCloudDocumentaiV1DeployProcessorVersionRequest, name: &str, ) -> ProjectLocationProcessorProcessorVersionDeployCall<'a, C>
Create a builder to help you perform the following task:
Deploys the processor version.
§Arguments
request- No description provided.name- Required. The processor version resource name to be deployed.
Sourcepub fn locations_processors_processor_versions_evaluate_processor_version(
&self,
request: GoogleCloudDocumentaiV1EvaluateProcessorVersionRequest,
processor_version: &str,
) -> ProjectLocationProcessorProcessorVersionEvaluateProcessorVersionCall<'a, C>
pub fn locations_processors_processor_versions_evaluate_processor_version( &self, request: GoogleCloudDocumentaiV1EvaluateProcessorVersionRequest, processor_version: &str, ) -> ProjectLocationProcessorProcessorVersionEvaluateProcessorVersionCall<'a, C>
Create a builder to help you perform the following task:
Evaluates a ProcessorVersion against annotated documents, producing an Evaluation.
§Arguments
request- No description provided.processorVersion- Required. The resource name of the ProcessorVersion to evaluate.projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}
Sourcepub fn locations_processors_processor_versions_get(
&self,
name: &str,
) -> ProjectLocationProcessorProcessorVersionGetCall<'a, C>
pub fn locations_processors_processor_versions_get( &self, name: &str, ) -> ProjectLocationProcessorProcessorVersionGetCall<'a, C>
Create a builder to help you perform the following task:
Gets a processor version detail.
§Arguments
name- Required. The processor resource name.
Sourcepub fn locations_processors_processor_versions_list(
&self,
parent: &str,
) -> ProjectLocationProcessorProcessorVersionListCall<'a, C>
pub fn locations_processors_processor_versions_list( &self, parent: &str, ) -> ProjectLocationProcessorProcessorVersionListCall<'a, C>
Create a builder to help you perform the following task:
Lists all versions of a processor.
§Arguments
parent- Required. The parent (project, location and processor) to list all versions. Format:projects/{project}/locations/{location}/processors/{processor}
Sourcepub fn locations_processors_processor_versions_process(
&self,
request: GoogleCloudDocumentaiV1ProcessRequest,
name: &str,
) -> ProjectLocationProcessorProcessorVersionProcesCall<'a, C>
pub fn locations_processors_processor_versions_process( &self, request: GoogleCloudDocumentaiV1ProcessRequest, name: &str, ) -> ProjectLocationProcessorProcessorVersionProcesCall<'a, C>
Create a builder to help you perform the following task:
Processes a single document.
§Arguments
request- No description provided.name- Required. The resource name of the Processor or ProcessorVersion to use for processing. If a Processor is specified, the server will use its default version. Format:projects/{project}/locations/{location}/processors/{processor}, orprojects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}
Sourcepub fn locations_processors_processor_versions_train(
&self,
request: GoogleCloudDocumentaiV1TrainProcessorVersionRequest,
parent: &str,
) -> ProjectLocationProcessorProcessorVersionTrainCall<'a, C>
pub fn locations_processors_processor_versions_train( &self, request: GoogleCloudDocumentaiV1TrainProcessorVersionRequest, parent: &str, ) -> ProjectLocationProcessorProcessorVersionTrainCall<'a, C>
Create a builder to help you perform the following task:
Trains a new processor version. Operation metadata is returned as TrainProcessorVersionMetadata.
§Arguments
request- No description provided.parent- Required. The parent (project, location and processor) to create the new version for. Format:projects/{project}/locations/{location}/processors/{processor}.
Sourcepub fn locations_processors_processor_versions_undeploy(
&self,
request: GoogleCloudDocumentaiV1UndeployProcessorVersionRequest,
name: &str,
) -> ProjectLocationProcessorProcessorVersionUndeployCall<'a, C>
pub fn locations_processors_processor_versions_undeploy( &self, request: GoogleCloudDocumentaiV1UndeployProcessorVersionRequest, name: &str, ) -> ProjectLocationProcessorProcessorVersionUndeployCall<'a, C>
Create a builder to help you perform the following task:
Undeploys the processor version.
§Arguments
request- No description provided.name- Required. The processor version resource name to be undeployed.
Sourcepub fn locations_processors_batch_process(
&self,
request: GoogleCloudDocumentaiV1BatchProcessRequest,
name: &str,
) -> ProjectLocationProcessorBatchProcesCall<'a, C>
pub fn locations_processors_batch_process( &self, request: GoogleCloudDocumentaiV1BatchProcessRequest, name: &str, ) -> ProjectLocationProcessorBatchProcesCall<'a, C>
Create a builder to help you perform the following task:
LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the Document format.
§Arguments
request- No description provided.name- Required. The resource name of Processor or ProcessorVersion. Format:projects/{project}/locations/{location}/processors/{processor}, orprojects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}
Sourcepub fn locations_processors_create(
&self,
request: GoogleCloudDocumentaiV1Processor,
parent: &str,
) -> ProjectLocationProcessorCreateCall<'a, C>
pub fn locations_processors_create( &self, request: GoogleCloudDocumentaiV1Processor, parent: &str, ) -> ProjectLocationProcessorCreateCall<'a, C>
Create a builder to help you perform the following task:
Creates a processor from the ProcessorType provided. The processor will be at ENABLED state by default after its creation. Note that this method requires the documentai.processors.create permission on the project, which is highly privileged. A user or service account with this permission can create new processors that can interact with any gcs bucket in your project.
§Arguments
request- No description provided.parent- Required. The parent (project and location) under which to create the processor. Format:projects/{project}/locations/{location}
Sourcepub fn locations_processors_delete(
&self,
name: &str,
) -> ProjectLocationProcessorDeleteCall<'a, C>
pub fn locations_processors_delete( &self, name: &str, ) -> ProjectLocationProcessorDeleteCall<'a, C>
Create a builder to help you perform the following task:
Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes all artifacts associated with this processor.
§Arguments
name- Required. The processor resource name to be deleted.
Sourcepub fn locations_processors_disable(
&self,
request: GoogleCloudDocumentaiV1DisableProcessorRequest,
name: &str,
) -> ProjectLocationProcessorDisableCall<'a, C>
pub fn locations_processors_disable( &self, request: GoogleCloudDocumentaiV1DisableProcessorRequest, name: &str, ) -> ProjectLocationProcessorDisableCall<'a, C>
Create a builder to help you perform the following task:
Disables a processor
§Arguments
request- No description provided.name- Required. The processor resource name to be disabled.
Sourcepub fn locations_processors_enable(
&self,
request: GoogleCloudDocumentaiV1EnableProcessorRequest,
name: &str,
) -> ProjectLocationProcessorEnableCall<'a, C>
pub fn locations_processors_enable( &self, request: GoogleCloudDocumentaiV1EnableProcessorRequest, name: &str, ) -> ProjectLocationProcessorEnableCall<'a, C>
Create a builder to help you perform the following task:
Enables a processor
§Arguments
request- No description provided.name- Required. The processor resource name to be enabled.
Sourcepub fn locations_processors_get(
&self,
name: &str,
) -> ProjectLocationProcessorGetCall<'a, C>
pub fn locations_processors_get( &self, name: &str, ) -> ProjectLocationProcessorGetCall<'a, C>
Create a builder to help you perform the following task:
Gets a processor detail.
§Arguments
name- Required. The processor resource name.
Sourcepub fn locations_processors_list(
&self,
parent: &str,
) -> ProjectLocationProcessorListCall<'a, C>
pub fn locations_processors_list( &self, parent: &str, ) -> ProjectLocationProcessorListCall<'a, C>
Create a builder to help you perform the following task:
Lists all processors which belong to this project.
§Arguments
parent- Required. The parent (project and location) which owns this collection of Processors. Format:projects/{project}/locations/{location}
Sourcepub fn locations_processors_process(
&self,
request: GoogleCloudDocumentaiV1ProcessRequest,
name: &str,
) -> ProjectLocationProcessorProcesCall<'a, C>
pub fn locations_processors_process( &self, request: GoogleCloudDocumentaiV1ProcessRequest, name: &str, ) -> ProjectLocationProcessorProcesCall<'a, C>
Create a builder to help you perform the following task:
Processes a single document.
§Arguments
request- No description provided.name- Required. The resource name of the Processor or ProcessorVersion to use for processing. If a Processor is specified, the server will use its default version. Format:projects/{project}/locations/{location}/processors/{processor}, orprojects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}
Sourcepub fn locations_processors_set_default_processor_version(
&self,
request: GoogleCloudDocumentaiV1SetDefaultProcessorVersionRequest,
processor: &str,
) -> ProjectLocationProcessorSetDefaultProcessorVersionCall<'a, C>
pub fn locations_processors_set_default_processor_version( &self, request: GoogleCloudDocumentaiV1SetDefaultProcessorVersionRequest, processor: &str, ) -> ProjectLocationProcessorSetDefaultProcessorVersionCall<'a, C>
Create a builder to help you perform the following task:
Set the default (active) version of a Processor that will be used in ProcessDocument and BatchProcessDocuments.
§Arguments
request- No description provided.processor- Required. The resource name of the Processor to change default version.
Sourcepub fn locations_fetch_processor_types(
&self,
parent: &str,
) -> ProjectLocationFetchProcessorTypeCall<'a, C>
pub fn locations_fetch_processor_types( &self, parent: &str, ) -> ProjectLocationFetchProcessorTypeCall<'a, C>
Create a builder to help you perform the following task:
Fetches processor types. Note that we don’t use ListProcessorTypes here, because it isn’t paginated.
§Arguments
parent- Required. The location of processor types to list. Format:projects/{project}/locations/{location}.
Sourcepub fn locations_get(&self, name: &str) -> ProjectLocationGetCall<'a, C>
pub fn locations_get(&self, name: &str) -> ProjectLocationGetCall<'a, C>
Create a builder to help you perform the following task:
Gets information about a location.
§Arguments
name- Resource name for the location.
Sourcepub fn locations_list(&self, name: &str) -> ProjectLocationListCall<'a, C>
pub fn locations_list(&self, name: &str) -> ProjectLocationListCall<'a, C>
Create a builder to help you perform the following task:
Lists information about the supported locations for this service.
§Arguments
name- The resource that owns the locations collection, if applicable.
Sourcepub fn operations_get(&self, name: &str) -> ProjectOperationGetCall<'a, C>
pub fn operations_get(&self, name: &str) -> ProjectOperationGetCall<'a, C>
Create a builder to help you perform the following task:
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
§Arguments
name- The name of the operation resource.
Trait Implementations§
impl<'a, C> MethodsBuilder for ProjectMethods<'a, C>
Auto Trait Implementations§
impl<'a, C> Freeze for ProjectMethods<'a, C>
impl<'a, C> !RefUnwindSafe for ProjectMethods<'a, C>
impl<'a, C> Send for ProjectMethods<'a, C>where
C: Sync,
impl<'a, C> Sync for ProjectMethods<'a, C>where
C: Sync,
impl<'a, C> Unpin for ProjectMethods<'a, C>
impl<'a, C> !UnwindSafe for ProjectMethods<'a, C>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more