Googly.DocumentAI.Projects.Locations.Processors.ProcessorVersions (googly_document_ai v0.1.0)

Copy Markdown View Source

Endpoints for the Projects.Locations.Processors.ProcessorVersions resource.

Summary

Functions

LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.

Deletes the processor version, all artifacts under the processor version will be deleted.

Deploys the processor version.

Evaluates a ProcessorVersion against annotated documents, producing an Evaluation.

Gets a processor version detail.

Lists all versions of a processor.

Processes a single document.

Trains a new processor version. Operation metadata is returned as TrainProcessorVersionMetadata.

Undeploys the processor version.

Functions

batch_process(name, opts \\ [])

@spec batch_process(
  String.t(),
  keyword()
) ::
  {:ok, Googly.DocumentAI.Model.GoogleLongrunningOperation.t()}
  | {:error, term()}

LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.

Parameters

  • name (type: String.t()) - Required. The resource name of Processor or ProcessorVersion. Format: projects/{project}/locations/{location}/processors/{processor}, or projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}
  • opts (type: keyword()) - Query and call options (:token, plus any of the below)
    • access_token (type: String.t()) - OAuth access token.
    • alt (type: String.t()) - Data format for response.
    • callback (type: String.t()) - JSONP
    • fields (type: String.t()) - Selector specifying which fields to include in a partial response.
    • key (type: String.t()) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token (type: String.t()) - OAuth 2.0 token for the current user.
    • pretty_print (type: boolean()) - Returns response with indentations and line breaks.
    • quota_user (type: String.t()) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol (type: String.t()) - Upload protocol for media (e.g. "raw", "multipart").
    • upload_type (type: String.t()) - Legacy upload protocol for media (e.g. "media", "multipart").
    • xgafv (type: String.t()) - V1 error format.
    • body (type: Googly.DocumentAI.Model.GoogleCloudDocumentaiV1BatchProcessRequest.t()) -

Returns

  • {:ok, %Googly.DocumentAI.Model.GoogleLongrunningOperation{}} on success
  • {:error, %Googly.DocumentAI.Error{}} on failure

delete(name, opts \\ [])

@spec delete(
  String.t(),
  keyword()
) ::
  {:ok, Googly.DocumentAI.Model.GoogleLongrunningOperation.t()}
  | {:error, term()}

Deletes the processor version, all artifacts under the processor version will be deleted.

Parameters

  • name (type: String.t()) - Required. The processor version resource name to be deleted.
  • opts (type: keyword()) - Query and call options (:token, plus any of the below)
    • access_token (type: String.t()) - OAuth access token.
    • alt (type: String.t()) - Data format for response.
    • callback (type: String.t()) - JSONP
    • fields (type: String.t()) - Selector specifying which fields to include in a partial response.
    • key (type: String.t()) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token (type: String.t()) - OAuth 2.0 token for the current user.
    • pretty_print (type: boolean()) - Returns response with indentations and line breaks.
    • quota_user (type: String.t()) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol (type: String.t()) - Upload protocol for media (e.g. "raw", "multipart").
    • upload_type (type: String.t()) - Legacy upload protocol for media (e.g. "media", "multipart").
    • xgafv (type: String.t()) - V1 error format.

Returns

  • {:ok, %Googly.DocumentAI.Model.GoogleLongrunningOperation{}} on success
  • {:error, %Googly.DocumentAI.Error{}} on failure

deploy(name, opts \\ [])

@spec deploy(
  String.t(),
  keyword()
) ::
  {:ok, Googly.DocumentAI.Model.GoogleLongrunningOperation.t()}
  | {:error, term()}

Deploys the processor version.

Parameters

  • name (type: String.t()) - Required. The processor version resource name to be deployed.
  • opts (type: keyword()) - Query and call options (:token, plus any of the below)
    • access_token (type: String.t()) - OAuth access token.
    • alt (type: String.t()) - Data format for response.
    • callback (type: String.t()) - JSONP
    • fields (type: String.t()) - Selector specifying which fields to include in a partial response.
    • key (type: String.t()) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token (type: String.t()) - OAuth 2.0 token for the current user.
    • pretty_print (type: boolean()) - Returns response with indentations and line breaks.
    • quota_user (type: String.t()) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol (type: String.t()) - Upload protocol for media (e.g. "raw", "multipart").
    • upload_type (type: String.t()) - Legacy upload protocol for media (e.g. "media", "multipart").
    • xgafv (type: String.t()) - V1 error format.
    • body (type: Googly.DocumentAI.Model.GoogleCloudDocumentaiV1DeployProcessorVersionRequest.t()) -

Returns

  • {:ok, %Googly.DocumentAI.Model.GoogleLongrunningOperation{}} on success
  • {:error, %Googly.DocumentAI.Error{}} on failure

evaluate_processor_version(processor_version, opts \\ [])

@spec evaluate_processor_version(
  String.t(),
  keyword()
) ::
  {:ok, Googly.DocumentAI.Model.GoogleLongrunningOperation.t()}
  | {:error, term()}

Evaluates a ProcessorVersion against annotated documents, producing an Evaluation.

Parameters

  • processor_version (type: String.t()) - Required. The resource name of the ProcessorVersion to evaluate. projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}
  • opts (type: keyword()) - Query and call options (:token, plus any of the below)
    • access_token (type: String.t()) - OAuth access token.
    • alt (type: String.t()) - Data format for response.
    • callback (type: String.t()) - JSONP
    • fields (type: String.t()) - Selector specifying which fields to include in a partial response.
    • key (type: String.t()) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token (type: String.t()) - OAuth 2.0 token for the current user.
    • pretty_print (type: boolean()) - Returns response with indentations and line breaks.
    • quota_user (type: String.t()) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol (type: String.t()) - Upload protocol for media (e.g. "raw", "multipart").
    • upload_type (type: String.t()) - Legacy upload protocol for media (e.g. "media", "multipart").
    • xgafv (type: String.t()) - V1 error format.
    • body (type: Googly.DocumentAI.Model.GoogleCloudDocumentaiV1EvaluateProcessorVersionRequest.t()) -

Returns

  • {:ok, %Googly.DocumentAI.Model.GoogleLongrunningOperation{}} on success
  • {:error, %Googly.DocumentAI.Error{}} on failure

get(name, opts \\ [])

Gets a processor version detail.

Parameters

  • name (type: String.t()) - Required. The processor resource name.
  • opts (type: keyword()) - Query and call options (:token, plus any of the below)
    • access_token (type: String.t()) - OAuth access token.
    • alt (type: String.t()) - Data format for response.
    • callback (type: String.t()) - JSONP
    • fields (type: String.t()) - Selector specifying which fields to include in a partial response.
    • key (type: String.t()) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token (type: String.t()) - OAuth 2.0 token for the current user.
    • pretty_print (type: boolean()) - Returns response with indentations and line breaks.
    • quota_user (type: String.t()) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol (type: String.t()) - Upload protocol for media (e.g. "raw", "multipart").
    • upload_type (type: String.t()) - Legacy upload protocol for media (e.g. "media", "multipart").
    • xgafv (type: String.t()) - V1 error format.

Returns

  • {:ok, %Googly.DocumentAI.Model.GoogleCloudDocumentaiV1ProcessorVersion{}} on success
  • {:error, %Googly.DocumentAI.Error{}} on failure

list(parent, opts \\ [])

Lists all versions of a processor.

Parameters

  • parent (type: String.t()) - Required. The parent (project, location and processor) to list all versions. Format: projects/{project}/locations/{location}/processors/{processor}
  • opts (type: keyword()) - Query and call options (:token, plus any of the below)
    • access_token (type: String.t()) - OAuth access token.
    • alt (type: String.t()) - Data format for response.
    • callback (type: String.t()) - JSONP
    • fields (type: String.t()) - Selector specifying which fields to include in a partial response.
    • key (type: String.t()) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token (type: String.t()) - OAuth 2.0 token for the current user.
    • pretty_print (type: boolean()) - Returns response with indentations and line breaks.
    • quota_user (type: String.t()) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol (type: String.t()) - Upload protocol for media (e.g. "raw", "multipart").
    • upload_type (type: String.t()) - Legacy upload protocol for media (e.g. "media", "multipart").
    • xgafv (type: String.t()) - V1 error format.
    • page_size (type: integer()) - The maximum number of processor versions to return. If unspecified, at most 10 processor versions will be returned. The maximum value is 20. Values above 20 will be coerced to 20.
    • page_token (type: String.t()) - We will return the processor versions sorted by creation time. The page token will point to the next processor version.

Returns

  • {:ok, %Googly.DocumentAI.Model.GoogleCloudDocumentaiV1ListProcessorVersionsResponse{}} on success
  • {:error, %Googly.DocumentAI.Error{}} on failure

process(name, opts \\ [])

Processes a single document.

Parameters

  • name (type: String.t()) - 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}, or projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}
  • opts (type: keyword()) - Query and call options (:token, plus any of the below)
    • access_token (type: String.t()) - OAuth access token.
    • alt (type: String.t()) - Data format for response.
    • callback (type: String.t()) - JSONP
    • fields (type: String.t()) - Selector specifying which fields to include in a partial response.
    • key (type: String.t()) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token (type: String.t()) - OAuth 2.0 token for the current user.
    • pretty_print (type: boolean()) - Returns response with indentations and line breaks.
    • quota_user (type: String.t()) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol (type: String.t()) - Upload protocol for media (e.g. "raw", "multipart").
    • upload_type (type: String.t()) - Legacy upload protocol for media (e.g. "media", "multipart").
    • xgafv (type: String.t()) - V1 error format.
    • body (type: Googly.DocumentAI.Model.GoogleCloudDocumentaiV1ProcessRequest.t()) -

Returns

  • {:ok, %Googly.DocumentAI.Model.GoogleCloudDocumentaiV1ProcessResponse{}} on success
  • {:error, %Googly.DocumentAI.Error{}} on failure

train(parent, opts \\ [])

@spec train(
  String.t(),
  keyword()
) ::
  {:ok, Googly.DocumentAI.Model.GoogleLongrunningOperation.t()}
  | {:error, term()}

Trains a new processor version. Operation metadata is returned as TrainProcessorVersionMetadata.

Parameters

  • parent (type: String.t()) - Required. The parent (project, location and processor) to create the new version for. Format: projects/{project}/locations/{location}/processors/{processor}.
  • opts (type: keyword()) - Query and call options (:token, plus any of the below)
    • access_token (type: String.t()) - OAuth access token.
    • alt (type: String.t()) - Data format for response.
    • callback (type: String.t()) - JSONP
    • fields (type: String.t()) - Selector specifying which fields to include in a partial response.
    • key (type: String.t()) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token (type: String.t()) - OAuth 2.0 token for the current user.
    • pretty_print (type: boolean()) - Returns response with indentations and line breaks.
    • quota_user (type: String.t()) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol (type: String.t()) - Upload protocol for media (e.g. "raw", "multipart").
    • upload_type (type: String.t()) - Legacy upload protocol for media (e.g. "media", "multipart").
    • xgafv (type: String.t()) - V1 error format.
    • body (type: Googly.DocumentAI.Model.GoogleCloudDocumentaiV1TrainProcessorVersionRequest.t()) -

Returns

  • {:ok, %Googly.DocumentAI.Model.GoogleLongrunningOperation{}} on success
  • {:error, %Googly.DocumentAI.Error{}} on failure

undeploy(name, opts \\ [])

@spec undeploy(
  String.t(),
  keyword()
) ::
  {:ok, Googly.DocumentAI.Model.GoogleLongrunningOperation.t()}
  | {:error, term()}

Undeploys the processor version.

Parameters

  • name (type: String.t()) - Required. The processor version resource name to be undeployed.
  • opts (type: keyword()) - Query and call options (:token, plus any of the below)
    • access_token (type: String.t()) - OAuth access token.
    • alt (type: String.t()) - Data format for response.
    • callback (type: String.t()) - JSONP
    • fields (type: String.t()) - Selector specifying which fields to include in a partial response.
    • key (type: String.t()) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token (type: String.t()) - OAuth 2.0 token for the current user.
    • pretty_print (type: boolean()) - Returns response with indentations and line breaks.
    • quota_user (type: String.t()) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol (type: String.t()) - Upload protocol for media (e.g. "raw", "multipart").
    • upload_type (type: String.t()) - Legacy upload protocol for media (e.g. "media", "multipart").
    • xgafv (type: String.t()) - V1 error format.
    • body (type: Googly.DocumentAI.Model.GoogleCloudDocumentaiV1UndeployProcessorVersionRequest.t()) -

Returns

  • {:ok, %Googly.DocumentAI.Model.GoogleLongrunningOperation{}} on success
  • {:error, %Googly.DocumentAI.Error{}} on failure