From 25ed938c3f022b40c154692da61a097cb4ced969 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Thu, 1 Oct 2020 05:52:06 -0700 Subject: [PATCH 1/7] changes without context autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. --- docs/gapic/v1beta3/api.rst | 6 + docs/gapic/v1beta3/types.rst | 5 + google/__init__.py | 24 + google/cloud/__init__.py | 24 + google/cloud/documentai/__init__.py | 68 - google/cloud/documentai/v1beta3.py | 29 + google/cloud/documentai/v1beta3/__init__.py | 47 + .../documentai/v1beta3/gapic/__init__.py | 0 .../document_processor_service_client.py | 488 ++ ...ocument_processor_service_client_config.py | 47 + .../cloud/documentai/v1beta3/gapic/enums.py | 157 + .../v1beta3/gapic/transports/__init__.py | 0 ...cument_processor_service_grpc_transport.py | 159 + google/cloud/documentai/v1beta3/types.py | 72 + .../documentai_v1beta3/proto/__init__.py | 0 .../documentai_v1beta3/proto/document_pb2.py | 4756 +++++++++++++++++ .../proto/document_pb2_grpc.py | 3 + .../proto/document_processor_service_pb2.py | 1290 +++++ .../document_processor_service_pb2_grpc.py | 185 + .../documentai_v1beta3/proto/geometry_pb2.py | 270 + .../proto/geometry_pb2_grpc.py | 3 + synth.metadata | 122 +- ...cument_processor_service_client_v1beta3.py | 215 + 23 files changed, 7900 insertions(+), 70 deletions(-) create mode 100644 docs/gapic/v1beta3/api.rst create mode 100644 docs/gapic/v1beta3/types.rst create mode 100644 google/__init__.py create mode 100644 google/cloud/__init__.py create mode 100644 google/cloud/documentai/v1beta3.py create mode 100644 google/cloud/documentai/v1beta3/__init__.py create mode 100644 google/cloud/documentai/v1beta3/gapic/__init__.py create mode 100644 google/cloud/documentai/v1beta3/gapic/document_processor_service_client.py create mode 100644 google/cloud/documentai/v1beta3/gapic/document_processor_service_client_config.py create mode 100644 google/cloud/documentai/v1beta3/gapic/enums.py create mode 100644 google/cloud/documentai/v1beta3/gapic/transports/__init__.py create mode 100644 google/cloud/documentai/v1beta3/gapic/transports/document_processor_service_grpc_transport.py create mode 100644 google/cloud/documentai/v1beta3/types.py create mode 100644 google/cloud/documentai_v1beta3/proto/__init__.py create mode 100644 google/cloud/documentai_v1beta3/proto/document_pb2.py create mode 100644 google/cloud/documentai_v1beta3/proto/document_pb2_grpc.py create mode 100644 google/cloud/documentai_v1beta3/proto/document_processor_service_pb2.py create mode 100644 google/cloud/documentai_v1beta3/proto/document_processor_service_pb2_grpc.py create mode 100644 google/cloud/documentai_v1beta3/proto/geometry_pb2.py create mode 100644 google/cloud/documentai_v1beta3/proto/geometry_pb2_grpc.py create mode 100644 tests/unit/gapic/v1beta3/test_document_processor_service_client_v1beta3.py diff --git a/docs/gapic/v1beta3/api.rst b/docs/gapic/v1beta3/api.rst new file mode 100644 index 00000000..e3af7d64 --- /dev/null +++ b/docs/gapic/v1beta3/api.rst @@ -0,0 +1,6 @@ +Client for Cloud Document AI API +================================ + +.. automodule:: google.cloud.documentai.v1beta3 + :members: + :inherited-members: \ No newline at end of file diff --git a/docs/gapic/v1beta3/types.rst b/docs/gapic/v1beta3/types.rst new file mode 100644 index 00000000..2bde19f3 --- /dev/null +++ b/docs/gapic/v1beta3/types.rst @@ -0,0 +1,5 @@ +Types for Cloud Document AI API Client +====================================== + +.. automodule:: google.cloud.documentai.v1beta3.types + :members: \ No newline at end of file diff --git a/google/__init__.py b/google/__init__.py new file mode 100644 index 00000000..9a1b64a6 --- /dev/null +++ b/google/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/google/cloud/__init__.py b/google/cloud/__init__.py new file mode 100644 index 00000000..9a1b64a6 --- /dev/null +++ b/google/cloud/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/google/cloud/documentai/__init__.py b/google/cloud/documentai/__init__.py index edd80431..e69de29b 100644 --- a/google/cloud/documentai/__init__.py +++ b/google/cloud/documentai/__init__.py @@ -1,68 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -from google.cloud.documentai_v1beta3.services.document_processor_service.async_client import ( - DocumentProcessorServiceAsyncClient, -) -from google.cloud.documentai_v1beta3.services.document_processor_service.client import ( - DocumentProcessorServiceClient, -) -from google.cloud.documentai_v1beta3.types.document import Document -from google.cloud.documentai_v1beta3.types.document_processor_service import ( - BatchProcessMetadata, -) -from google.cloud.documentai_v1beta3.types.document_processor_service import ( - BatchProcessRequest, -) -from google.cloud.documentai_v1beta3.types.document_processor_service import ( - BatchProcessResponse, -) -from google.cloud.documentai_v1beta3.types.document_processor_service import ( - ProcessRequest, -) -from google.cloud.documentai_v1beta3.types.document_processor_service import ( - ProcessResponse, -) -from google.cloud.documentai_v1beta3.types.document_processor_service import ( - ReviewDocumentOperationMetadata, -) -from google.cloud.documentai_v1beta3.types.document_processor_service import ( - ReviewDocumentRequest, -) -from google.cloud.documentai_v1beta3.types.document_processor_service import ( - ReviewDocumentResponse, -) -from google.cloud.documentai_v1beta3.types.geometry import BoundingPoly -from google.cloud.documentai_v1beta3.types.geometry import NormalizedVertex -from google.cloud.documentai_v1beta3.types.geometry import Vertex - -__all__ = ( - "BatchProcessMetadata", - "BatchProcessRequest", - "BatchProcessResponse", - "BoundingPoly", - "Document", - "DocumentProcessorServiceAsyncClient", - "DocumentProcessorServiceClient", - "NormalizedVertex", - "ProcessRequest", - "ProcessResponse", - "ReviewDocumentOperationMetadata", - "ReviewDocumentRequest", - "ReviewDocumentResponse", - "Vertex", -) diff --git a/google/cloud/documentai/v1beta3.py b/google/cloud/documentai/v1beta3.py new file mode 100644 index 00000000..78fbdb61 --- /dev/null +++ b/google/cloud/documentai/v1beta3.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import absolute_import + +from google.cloud.documentai.v1beta3 import DocumentProcessorServiceClient +from google.cloud.documentai.v1beta3 import enums +from google.cloud.documentai.v1beta3 import types + + +__all__ = ( + "enums", + "types", + "DocumentProcessorServiceClient", +) diff --git a/google/cloud/documentai/v1beta3/__init__.py b/google/cloud/documentai/v1beta3/__init__.py new file mode 100644 index 00000000..81710100 --- /dev/null +++ b/google/cloud/documentai/v1beta3/__init__.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import absolute_import +import sys +import warnings + +from google.cloud.documentai.v1beta3 import types +from google.cloud.documentai.v1beta3.gapic import document_processor_service_client +from google.cloud.documentai.v1beta3.gapic import enums + + +if sys.version_info[:2] == (2, 7): + message = ( + "A future version of this library will drop support for Python 2.7. " + "More details about Python 2 support for Google Cloud Client Libraries " + "can be found at https://cloud.google.com/python/docs/python2-sunset/" + ) + warnings.warn(message, DeprecationWarning) + + +class DocumentProcessorServiceClient( + document_processor_service_client.DocumentProcessorServiceClient +): + __doc__ = document_processor_service_client.DocumentProcessorServiceClient.__doc__ + enums = enums + + +__all__ = ( + "enums", + "types", + "DocumentProcessorServiceClient", +) diff --git a/google/cloud/documentai/v1beta3/gapic/__init__.py b/google/cloud/documentai/v1beta3/gapic/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/google/cloud/documentai/v1beta3/gapic/document_processor_service_client.py b/google/cloud/documentai/v1beta3/gapic/document_processor_service_client.py new file mode 100644 index 00000000..dc55ef46 --- /dev/null +++ b/google/cloud/documentai/v1beta3/gapic/document_processor_service_client.py @@ -0,0 +1,488 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Accesses the google.cloud.documentai.v1beta3 DocumentProcessorService API.""" + +import pkg_resources +import warnings + +from google.oauth2 import service_account +import google.api_core.client_options +import google.api_core.gapic_v1.client_info +import google.api_core.gapic_v1.config +import google.api_core.gapic_v1.method +import google.api_core.gapic_v1.routing_header +import google.api_core.grpc_helpers +import google.api_core.operation +import google.api_core.operations_v1 +import google.api_core.path_template +import grpc + +from google.cloud.documentai.v1beta3.gapic import ( + document_processor_service_client_config, +) +from google.cloud.documentai.v1beta3.gapic import enums +from google.cloud.documentai.v1beta3.gapic.transports import ( + document_processor_service_grpc_transport, +) +from google.cloud.documentai.v1beta3.proto import document_pb2 +from google.cloud.documentai.v1beta3.proto import document_processor_service_pb2 +from google.cloud.documentai.v1beta3.proto import document_processor_service_pb2_grpc +from google.longrunning import operations_pb2 + + +_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( + "google-cloud-documentai", +).version + + +class DocumentProcessorServiceClient(object): + """ + 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. + """ + + SERVICE_ADDRESS = "us-documentai.googleapis.com:443" + """The default address of the service.""" + + # The name of the interface for this client. This is the key used to + # find the method configuration in the client_config dictionary. + _INTERFACE_NAME = "google.cloud.documentai.v1beta3.DocumentProcessorService" + + @classmethod + def from_service_account_file(cls, filename, *args, **kwargs): + """Creates an instance of this client using the provided credentials + file. + + Args: + filename (str): The path to the service account private key json + file. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + DocumentProcessorServiceClient: The constructed client. + """ + credentials = service_account.Credentials.from_service_account_file(filename) + kwargs["credentials"] = credentials + return cls(*args, **kwargs) + + from_service_account_json = from_service_account_file + + @classmethod + def human_review_config_path(cls, project, location, processor): + """Return a fully-qualified human_review_config string.""" + return google.api_core.path_template.expand( + "projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig", + project=project, + location=location, + processor=processor, + ) + + @classmethod + def processor_path(cls, project, location, processor): + """Return a fully-qualified processor string.""" + return google.api_core.path_template.expand( + "projects/{project}/locations/{location}/processors/{processor}", + project=project, + location=location, + processor=processor, + ) + + def __init__( + self, + transport=None, + channel=None, + credentials=None, + client_config=None, + client_info=None, + client_options=None, + ): + """Constructor. + + Args: + transport (Union[~.DocumentProcessorServiceGrpcTransport, + Callable[[~.Credentials, type], ~.DocumentProcessorServiceGrpcTransport]): A transport + instance, responsible for actually making the API calls. + The default transport uses the gRPC protocol. + This argument may also be a callable which returns a + transport instance. Callables will be sent the credentials + as the first argument and the default transport class as + the second argument. + channel (grpc.Channel): DEPRECATED. A ``Channel`` instance + through which to make calls. This argument is mutually exclusive + with ``credentials``; providing both will raise an exception. + credentials (google.auth.credentials.Credentials): The + authorization credentials to attach to requests. These + credentials identify this application to the service. If none + are specified, the client will attempt to ascertain the + credentials from the environment. + This argument is mutually exclusive with providing a + transport instance to ``transport``; doing so will raise + an exception. + client_config (dict): DEPRECATED. A dictionary of call options for + each method. If not specified, the default configuration is used. + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing + your own client library. + client_options (Union[dict, google.api_core.client_options.ClientOptions]): + Client options used to set user options on the client. API Endpoint + should be set through client_options. + """ + # Raise deprecation warnings for things we want to go away. + if client_config is not None: + warnings.warn( + "The `client_config` argument is deprecated.", + PendingDeprecationWarning, + stacklevel=2, + ) + else: + client_config = document_processor_service_client_config.config + + if channel: + warnings.warn( + "The `channel` argument is deprecated; use " "`transport` instead.", + PendingDeprecationWarning, + stacklevel=2, + ) + + api_endpoint = self.SERVICE_ADDRESS + if client_options: + if type(client_options) == dict: + client_options = google.api_core.client_options.from_dict( + client_options + ) + if client_options.api_endpoint: + api_endpoint = client_options.api_endpoint + + # Instantiate the transport. + # The transport is responsible for handling serialization and + # deserialization and actually sending data to the service. + if transport: + if callable(transport): + self.transport = transport( + credentials=credentials, + default_class=document_processor_service_grpc_transport.DocumentProcessorServiceGrpcTransport, + address=api_endpoint, + ) + else: + if credentials: + raise ValueError( + "Received both a transport instance and " + "credentials; these are mutually exclusive." + ) + self.transport = transport + else: + self.transport = document_processor_service_grpc_transport.DocumentProcessorServiceGrpcTransport( + address=api_endpoint, channel=channel, credentials=credentials, + ) + + if client_info is None: + client_info = google.api_core.gapic_v1.client_info.ClientInfo( + gapic_version=_GAPIC_LIBRARY_VERSION, + ) + else: + client_info.gapic_version = _GAPIC_LIBRARY_VERSION + self._client_info = client_info + + # Parse out the default settings for retry and timeout for each RPC + # from the client configuration. + # (Ordinarily, these are the defaults specified in the `*_config.py` + # file next to this one.) + self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( + client_config["interfaces"][self._INTERFACE_NAME], + ) + + # Save a dictionary of cached API call functions. + # These are the actual callables which invoke the proper + # transport methods, wrapped with `wrap_method` to add retry, + # timeout, and the like. + self._inner_api_calls = {} + + # Service calls + def process_document( + self, + name, + document=None, + skip_human_review=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Processes a single document. + + Example: + >>> from google.cloud.documentai import v1beta3 + >>> + >>> client = v1beta3.DocumentProcessorServiceClient() + >>> + >>> name = client.processor_path('[PROJECT]', '[LOCATION]', '[PROCESSOR]') + >>> + >>> response = client.process_document(name) + + Args: + name (str): Required. The processor resource name. + document (Union[dict, ~google.cloud.documentai.v1beta3.types.Document]): The document payload, the [content] and [mime_type] fields must be + set. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.documentai.v1beta3.types.Document` + skip_human_review (bool): Whether Human Review feature should be skipped for this request. Default to + false. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.documentai.v1beta3.types.ProcessResponse` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "process_document" not in self._inner_api_calls: + self._inner_api_calls[ + "process_document" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.process_document, + default_retry=self._method_configs["ProcessDocument"].retry, + default_timeout=self._method_configs["ProcessDocument"].timeout, + client_info=self._client_info, + ) + + request = document_processor_service_pb2.ProcessRequest( + name=name, document=document, skip_human_review=skip_human_review, + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["process_document"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def batch_process_documents( + self, + name, + input_configs=None, + output_config=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + LRO endpoint to batch process many documents. The output is written + to Cloud Storage as JSON in the [Document] format. + + Example: + >>> from google.cloud.documentai import v1beta3 + >>> + >>> client = v1beta3.DocumentProcessorServiceClient() + >>> + >>> name = client.processor_path('[PROJECT]', '[LOCATION]', '[PROCESSOR]') + >>> + >>> response = client.batch_process_documents(name) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() + + Args: + name (str): Required. The processor resource name. + input_configs (list[Union[dict, ~google.cloud.documentai.v1beta3.types.BatchInputConfig]]): The input config for each single document in the batch process. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.documentai.v1beta3.types.BatchInputConfig` + output_config (Union[dict, ~google.cloud.documentai.v1beta3.types.BatchOutputConfig]): The overall output config for batch process. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.documentai.v1beta3.types.BatchOutputConfig` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.documentai.v1beta3.types._OperationFuture` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "batch_process_documents" not in self._inner_api_calls: + self._inner_api_calls[ + "batch_process_documents" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.batch_process_documents, + default_retry=self._method_configs["BatchProcessDocuments"].retry, + default_timeout=self._method_configs["BatchProcessDocuments"].timeout, + client_info=self._client_info, + ) + + request = document_processor_service_pb2.BatchProcessRequest( + name=name, input_configs=input_configs, output_config=output_config, + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + operation = self._inner_api_calls["batch_process_documents"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + return google.api_core.operation.from_gapic( + operation, + self.transport._operations_client, + document_processor_service_pb2.BatchProcessResponse, + metadata_type=document_processor_service_pb2.BatchProcessMetadata, + ) + + def review_document( + self, + human_review_config, + document=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Send a document for Human Review. The input document should be processed by + the specified processor. + + Example: + >>> from google.cloud.documentai import v1beta3 + >>> + >>> client = v1beta3.DocumentProcessorServiceClient() + >>> + >>> human_review_config = client.human_review_config_path('[PROJECT]', '[LOCATION]', '[PROCESSOR]') + >>> + >>> response = client.review_document(human_review_config) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() + + Args: + human_review_config (str): Required. The resource name of the HumanReviewConfig that the document will be + reviewed with. + document (Union[dict, ~google.cloud.documentai.v1beta3.types.Document]): The document that needs human review. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.documentai.v1beta3.types.Document` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.documentai.v1beta3.types._OperationFuture` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "review_document" not in self._inner_api_calls: + self._inner_api_calls[ + "review_document" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.review_document, + default_retry=self._method_configs["ReviewDocument"].retry, + default_timeout=self._method_configs["ReviewDocument"].timeout, + client_info=self._client_info, + ) + + request = document_processor_service_pb2.ReviewDocumentRequest( + human_review_config=human_review_config, document=document, + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("human_review_config", human_review_config)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + operation = self._inner_api_calls["review_document"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + return google.api_core.operation.from_gapic( + operation, + self.transport._operations_client, + document_processor_service_pb2.ReviewDocumentResponse, + metadata_type=document_processor_service_pb2.ReviewDocumentOperationMetadata, + ) diff --git a/google/cloud/documentai/v1beta3/gapic/document_processor_service_client_config.py b/google/cloud/documentai/v1beta3/gapic/document_processor_service_client_config.py new file mode 100644 index 00000000..9e3dfa47 --- /dev/null +++ b/google/cloud/documentai/v1beta3/gapic/document_processor_service_client_config.py @@ -0,0 +1,47 @@ +config = { + "interfaces": { + "google.cloud.documentai.v1beta3.DocumentProcessorService": { + "retry_codes": { + "retry_policy_1_codes": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], + "no_retry_codes": [], + }, + "retry_params": { + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 120000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 120000, + "total_timeout_millis": 120000, + }, + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0, + }, + }, + "methods": { + "ProcessDocument": { + "timeout_millis": 120000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params", + }, + "BatchProcessDocuments": { + "timeout_millis": 120000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params", + }, + "ReviewDocument": { + "timeout_millis": 120000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params", + }, + }, + } + } +} diff --git a/google/cloud/documentai/v1beta3/gapic/enums.py b/google/cloud/documentai/v1beta3/gapic/enums.py new file mode 100644 index 00000000..e93640c5 --- /dev/null +++ b/google/cloud/documentai/v1beta3/gapic/enums.py @@ -0,0 +1,157 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Wrappers for protocol buffer enum types.""" + +import enum + + +class BatchProcessMetadata(object): + class State(enum.IntEnum): + """ + Possible states of the batch processing operation. + + Attributes: + STATE_UNSPECIFIED (int): The default value. This value is used if the state is omitted. + WAITING (int): Request operation is waiting for scheduling. + RUNNING (int): Request is being processed. + SUCCEEDED (int): The batch processing completed successfully. + CANCELLING (int): The batch processing was being cancelled. + CANCELLED (int): The batch processing was cancelled. + FAILED (int): The batch processing has failed. + """ + + STATE_UNSPECIFIED = 0 + WAITING = 1 + RUNNING = 2 + SUCCEEDED = 3 + CANCELLING = 4 + CANCELLED = 5 + FAILED = 6 + + +class Document(object): + class Page(object): + class Layout(object): + class Orientation(enum.IntEnum): + """ + Detected human reading orientation. + + Attributes: + ORIENTATION_UNSPECIFIED (int): Unspecified orientation. + PAGE_UP (int): Orientation is aligned with page up. + PAGE_RIGHT (int): Orientation is aligned with page right. + Turn the head 90 degrees clockwise from upright to read. + PAGE_DOWN (int): Orientation is aligned with page down. + Turn the head 180 degrees from upright to read. + PAGE_LEFT (int): Orientation is aligned with page left. + Turn the head 90 degrees counterclockwise from upright to read. + """ + + ORIENTATION_UNSPECIFIED = 0 + PAGE_UP = 1 + PAGE_RIGHT = 2 + PAGE_DOWN = 3 + PAGE_LEFT = 4 + + class Token(object): + class DetectedBreak(object): + class Type(enum.IntEnum): + """ + Enum to denote the type of break found. + + Attributes: + TYPE_UNSPECIFIED (int): Unspecified break type. + SPACE (int): A single whitespace. + WIDE_SPACE (int): A wider whitespace. + HYPHEN (int): A hyphen that indicates that a token has been split across lines. + """ + + TYPE_UNSPECIFIED = 0 + SPACE = 1 + WIDE_SPACE = 2 + HYPHEN = 3 + + class PageAnchor(object): + class PageRef(object): + class LayoutType(enum.IntEnum): + """ + The type of layout that is being referenced. + + Attributes: + LAYOUT_TYPE_UNSPECIFIED (int): Layout Unspecified. + BLOCK (int): References a ``Page.blocks`` element. + PARAGRAPH (int): References a ``Page.paragraphs`` element. + LINE (int): References a ``Page.lines`` element. + TOKEN (int): References a ``Page.tokens`` element. + VISUAL_ELEMENT (int): References a ``Page.visual_elements`` element. + TABLE (int): Refrrences a ``Page.tables`` element. + FORM_FIELD (int): References a ``Page.form_fields`` element. + """ + + LAYOUT_TYPE_UNSPECIFIED = 0 + BLOCK = 1 + PARAGRAPH = 2 + LINE = 3 + TOKEN = 4 + VISUAL_ELEMENT = 5 + TABLE = 6 + FORM_FIELD = 7 + + class Provenance(object): + class OperationType(enum.IntEnum): + """ + If a processor or agent does an explicit operation on existing elements. + + Attributes: + OPERATION_TYPE_UNSPECIFIED (int): Operation type unspecified. + ADD (int): Add an element. Implicit if no ``parents`` are set for the + provenance. + REMOVE (int): The element is removed. No ``parents`` should be set. + REPLACE (int): Explicitly replaces the element(s) identified by ``parents``. + EVAL_REQUESTED (int): Element is requested for human review. + EVAL_APPROVED (int): Element is review and approved at human review, confidence will be set + to 1.0 + """ + + OPERATION_TYPE_UNSPECIFIED = 0 + ADD = 1 + REMOVE = 2 + REPLACE = 3 + EVAL_REQUESTED = 4 + EVAL_APPROVED = 5 + + +class ReviewDocumentOperationMetadata(object): + class State(enum.IntEnum): + """ + State of the longrunning operation. + + Attributes: + STATE_UNSPECIFIED (int): Unspecified state. + RUNNING (int): Operation is still running. + CANCELLING (int): Operation is being cancelled. + SUCCEEDED (int): Operation succeeded. + FAILED (int): Operation failed. + CANCELLED (int): Operation is cancelled. + """ + + STATE_UNSPECIFIED = 0 + RUNNING = 1 + CANCELLING = 2 + SUCCEEDED = 3 + FAILED = 4 + CANCELLED = 5 diff --git a/google/cloud/documentai/v1beta3/gapic/transports/__init__.py b/google/cloud/documentai/v1beta3/gapic/transports/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/google/cloud/documentai/v1beta3/gapic/transports/document_processor_service_grpc_transport.py b/google/cloud/documentai/v1beta3/gapic/transports/document_processor_service_grpc_transport.py new file mode 100644 index 00000000..0d5aac7a --- /dev/null +++ b/google/cloud/documentai/v1beta3/gapic/transports/document_processor_service_grpc_transport.py @@ -0,0 +1,159 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import google.api_core.grpc_helpers +import google.api_core.operations_v1 + +from google.cloud.documentai.v1beta3.proto import document_processor_service_pb2_grpc + + +class DocumentProcessorServiceGrpcTransport(object): + """gRPC transport class providing stubs for + google.cloud.documentai.v1beta3 DocumentProcessorService API. + + The transport provides access to the raw gRPC stubs, + which can be used to take advantage of advanced + features of gRPC. + """ + + # The scopes needed to make gRPC calls to all of the methods defined + # in this service. + _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) + + def __init__( + self, channel=None, credentials=None, address="us-documentai.googleapis.com:443" + ): + """Instantiate the transport class. + + Args: + channel (grpc.Channel): A ``Channel`` instance through + which to make calls. This argument is mutually exclusive + with ``credentials``; providing both will raise an exception. + credentials (google.auth.credentials.Credentials): The + authorization credentials to attach to requests. These + credentials identify this application to the service. If none + are specified, the client will attempt to ascertain the + credentials from the environment. + address (str): The address where the service is hosted. + """ + # If both `channel` and `credentials` are specified, raise an + # exception (channels come with credentials baked in already). + if channel is not None and credentials is not None: + raise ValueError( + "The `channel` and `credentials` arguments are mutually " "exclusive.", + ) + + # Create the channel. + if channel is None: + channel = self.create_channel( + address=address, + credentials=credentials, + options={ + "grpc.max_send_message_length": -1, + "grpc.max_receive_message_length": -1, + }.items(), + ) + + self._channel = channel + + # gRPC uses objects called "stubs" that are bound to the + # channel and provide a basic method for each RPC. + self._stubs = { + "document_processor_service_stub": document_processor_service_pb2_grpc.DocumentProcessorServiceStub( + channel + ), + } + + # Because this API includes a method that returns a + # long-running operation (proto: google.longrunning.Operation), + # instantiate an LRO client. + self._operations_client = google.api_core.operations_v1.OperationsClient( + channel + ) + + @classmethod + def create_channel( + cls, address="us-documentai.googleapis.com:443", credentials=None, **kwargs + ): + """Create and return a gRPC channel object. + + Args: + address (str): The host for the channel to use. + credentials (~.Credentials): The + authorization credentials to attach to requests. These + credentials identify this application to the service. If + none are specified, the client will attempt to ascertain + the credentials from the environment. + kwargs (dict): Keyword arguments, which are passed to the + channel creation. + + Returns: + grpc.Channel: A gRPC channel object. + """ + return google.api_core.grpc_helpers.create_channel( + address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs + ) + + @property + def channel(self): + """The gRPC channel used by the transport. + + Returns: + grpc.Channel: A gRPC channel object. + """ + return self._channel + + @property + def process_document(self): + """Return the gRPC stub for :meth:`DocumentProcessorServiceClient.process_document`. + + Processes a single document. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["document_processor_service_stub"].ProcessDocument + + @property + def batch_process_documents(self): + """Return the gRPC stub for :meth:`DocumentProcessorServiceClient.batch_process_documents`. + + LRO endpoint to batch process many documents. The output is written + to Cloud Storage as JSON in the [Document] format. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["document_processor_service_stub"].BatchProcessDocuments + + @property + def review_document(self): + """Return the gRPC stub for :meth:`DocumentProcessorServiceClient.review_document`. + + Send a document for Human Review. The input document should be processed by + the specified processor. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["document_processor_service_stub"].ReviewDocument diff --git a/google/cloud/documentai/v1beta3/types.py b/google/cloud/documentai/v1beta3/types.py new file mode 100644 index 00000000..85063d97 --- /dev/null +++ b/google/cloud/documentai/v1beta3/types.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import absolute_import +import sys + +from google.api_core.protobuf_helpers import get_messages + +from google.cloud.documentai.v1beta3.proto import document_pb2 +from google.cloud.documentai.v1beta3.proto import document_processor_service_pb2 +from google.cloud.documentai.v1beta3.proto import geometry_pb2 +from google.longrunning import operations_pb2 +from google.protobuf import any_pb2 +from google.protobuf import duration_pb2 +from google.protobuf import timestamp_pb2 +from google.protobuf import wrappers_pb2 +from google.rpc import status_pb2 +from google.type import color_pb2 +from google.type import date_pb2 +from google.type import datetime_pb2 +from google.type import money_pb2 +from google.type import postal_address_pb2 + + +_shared_modules = [ + operations_pb2, + any_pb2, + duration_pb2, + timestamp_pb2, + wrappers_pb2, + status_pb2, + color_pb2, + date_pb2, + datetime_pb2, + money_pb2, + postal_address_pb2, +] + +_local_modules = [ + document_pb2, + document_processor_service_pb2, + geometry_pb2, +] + +names = [] + +for module in _shared_modules: # pragma: NO COVER + for name, message in get_messages(module).items(): + setattr(sys.modules[__name__], name, message) + names.append(name) +for module in _local_modules: + for name, message in get_messages(module).items(): + message.__module__ = "google.cloud.documentai.v1beta3.types" + setattr(sys.modules[__name__], name, message) + names.append(name) + + +__all__ = tuple(sorted(names)) diff --git a/google/cloud/documentai_v1beta3/proto/__init__.py b/google/cloud/documentai_v1beta3/proto/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/google/cloud/documentai_v1beta3/proto/document_pb2.py b/google/cloud/documentai_v1beta3/proto/document_pb2.py new file mode 100644 index 00000000..f6156276 --- /dev/null +++ b/google/cloud/documentai_v1beta3/proto/document_pb2.py @@ -0,0 +1,4756 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai_v1beta3/proto/document.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from google.cloud.documentai_v1beta3.proto import ( + geometry_pb2 as google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_geometry__pb2, +) +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 +from google.type import color_pb2 as google_dot_type_dot_color__pb2 +from google.type import date_pb2 as google_dot_type_dot_date__pb2 +from google.type import datetime_pb2 as google_dot_type_dot_datetime__pb2 +from google.type import money_pb2 as google_dot_type_dot_money__pb2 +from google.type import postal_address_pb2 as google_dot_type_dot_postal__address__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name="google/cloud/documentai_v1beta3/proto/document.proto", + package="google.cloud.documentai.v1beta3", + syntax="proto3", + serialized_options=b"\n#com.google.cloud.documentai.v1beta3B\rDocumentProtoP\001ZIgoogle.golang.org/genproto/googleapis/cloud/documentai/v1beta3;documentai\252\002\037Google.Cloud.DocumentAI.v1beta3\312\002\037Google\\Cloud\\DocumentAi\\v1beta3\352\002!Google::Cloud::DocumentAI::master", + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n4google/cloud/documentai_v1beta3/proto/document.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x34google/cloud/documentai_v1beta3/proto/geometry.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17google/type/color.proto\x1a\x16google/type/date.proto\x1a\x1agoogle/type/datetime.proto\x1a\x17google/type/money.proto\x1a google/type/postal_address.proto\x1a\x1cgoogle/api/annotations.proto"\xa5<\n\x08\x44ocument\x12\r\n\x03uri\x18\x01 \x01(\tH\x00\x12\x11\n\x07\x63ontent\x18\x02 \x01(\x0cH\x00\x12\x11\n\tmime_type\x18\x03 \x01(\t\x12\x0c\n\x04text\x18\x04 \x01(\t\x12\x44\n\x0btext_styles\x18\x05 \x03(\x0b\x32/.google.cloud.documentai.v1beta3.Document.Style\x12=\n\x05pages\x18\x06 \x03(\x0b\x32..google.cloud.documentai.v1beta3.Document.Page\x12\x42\n\x08\x65ntities\x18\x07 \x03(\x0b\x32\x30.google.cloud.documentai.v1beta3.Document.Entity\x12R\n\x10\x65ntity_relations\x18\x08 \x03(\x0b\x32\x38.google.cloud.documentai.v1beta3.Document.EntityRelation\x12K\n\x0ctranslations\x18\x0c \x03(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Translation\x12J\n\x0ctext_changes\x18\x0e \x03(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.TextChange\x12G\n\nshard_info\x18\t \x01(\x0b\x32\x33.google.cloud.documentai.v1beta3.Document.ShardInfo\x12!\n\x05\x65rror\x18\n \x01(\x0b\x32\x12.google.rpc.Status\x12\x45\n\trevisions\x18\r \x03(\x0b\x32\x32.google.cloud.documentai.v1beta3.Document.Revision\x1aJ\n\tShardInfo\x12\x13\n\x0bshard_index\x18\x01 \x01(\x03\x12\x13\n\x0bshard_count\x18\x02 \x01(\x03\x12\x13\n\x0btext_offset\x18\x03 \x01(\x03\x1a\xda\x02\n\x05Style\x12I\n\x0btext_anchor\x18\x01 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.TextAnchor\x12!\n\x05\x63olor\x18\x02 \x01(\x0b\x32\x12.google.type.Color\x12,\n\x10\x62\x61\x63kground_color\x18\x03 \x01(\x0b\x32\x12.google.type.Color\x12\x13\n\x0b\x66ont_weight\x18\x04 \x01(\t\x12\x12\n\ntext_style\x18\x05 \x01(\t\x12\x17\n\x0ftext_decoration\x18\x06 \x01(\t\x12K\n\tfont_size\x18\x07 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.Document.Style.FontSize\x1a&\n\x08\x46ontSize\x12\x0c\n\x04size\x18\x01 \x01(\x02\x12\x0c\n\x04unit\x18\x02 \x01(\t\x1a\xd0\x1f\n\x04Page\x12\x13\n\x0bpage_number\x18\x01 \x01(\x05\x12\x43\n\x05image\x18\r \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Page.Image\x12I\n\ntransforms\x18\x0e \x03(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Matrix\x12K\n\tdimension\x18\x02 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.Document.Page.Dimension\x12\x45\n\x06layout\x18\x03 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12[\n\x12\x64\x65tected_languages\x18\x04 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12\x44\n\x06\x62locks\x18\x05 \x03(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Page.Block\x12L\n\nparagraphs\x18\x06 \x03(\x0b\x32\x38.google.cloud.documentai.v1beta3.Document.Page.Paragraph\x12\x42\n\x05lines\x18\x07 \x03(\x0b\x32\x33.google.cloud.documentai.v1beta3.Document.Page.Line\x12\x44\n\x06tokens\x18\x08 \x03(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Page.Token\x12U\n\x0fvisual_elements\x18\t \x03(\x0b\x32<.google.cloud.documentai.v1beta3.Document.Page.VisualElement\x12\x44\n\x06tables\x18\n \x03(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Page.Table\x12M\n\x0b\x66orm_fields\x18\x0b \x03(\x0b\x32\x38.google.cloud.documentai.v1beta3.Document.Page.FormField\x1a\x38\n\tDimension\x12\r\n\x05width\x18\x01 \x01(\x02\x12\x0e\n\x06height\x18\x02 \x01(\x02\x12\x0c\n\x04unit\x18\x03 \x01(\t\x1aJ\n\x05Image\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\x0c\x12\x11\n\tmime_type\x18\x02 \x01(\t\x12\r\n\x05width\x18\x03 \x01(\x05\x12\x0e\n\x06height\x18\x04 \x01(\x05\x1a@\n\x06Matrix\x12\x0c\n\x04rows\x18\x01 \x01(\x05\x12\x0c\n\x04\x63ols\x18\x02 \x01(\x05\x12\x0c\n\x04type\x18\x03 \x01(\x05\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\x0c\x1a\xec\x02\n\x06Layout\x12I\n\x0btext_anchor\x18\x01 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.TextAnchor\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x44\n\rbounding_poly\x18\x03 \x01(\x0b\x32-.google.cloud.documentai.v1beta3.BoundingPoly\x12V\n\x0borientation\x18\x04 \x01(\x0e\x32\x41.google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation"e\n\x0bOrientation\x12\x1b\n\x17ORIENTATION_UNSPECIFIED\x10\x00\x12\x0b\n\x07PAGE_UP\x10\x01\x12\x0e\n\nPAGE_RIGHT\x10\x02\x12\r\n\tPAGE_DOWN\x10\x03\x12\r\n\tPAGE_LEFT\x10\x04\x1a\xf5\x01\n\x05\x42lock\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12[\n\x12\x64\x65tected_languages\x18\x02 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12H\n\nprovenance\x18\x03 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Provenance\x1a\xf9\x01\n\tParagraph\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12[\n\x12\x64\x65tected_languages\x18\x02 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12H\n\nprovenance\x18\x03 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Provenance\x1a\xf4\x01\n\x04Line\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12[\n\x12\x64\x65tected_languages\x18\x02 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12H\n\nprovenance\x18\x03 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Provenance\x1a\xff\x03\n\x05Token\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12Z\n\x0e\x64\x65tected_break\x18\x02 \x01(\x0b\x32\x42.google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak\x12[\n\x12\x64\x65tected_languages\x18\x03 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12H\n\nprovenance\x18\x04 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Provenance\x1a\xab\x01\n\rDetectedBreak\x12U\n\x04type\x18\x01 \x01(\x0e\x32G.google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type"C\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05SPACE\x10\x01\x12\x0e\n\nWIDE_SPACE\x10\x02\x12\n\n\x06HYPHEN\x10\x03\x1a\xc1\x01\n\rVisualElement\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12\x0c\n\x04type\x18\x02 \x01(\t\x12[\n\x12\x64\x65tected_languages\x18\x03 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x1a\x82\x05\n\x05Table\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12R\n\x0bheader_rows\x18\x02 \x03(\x0b\x32=.google.cloud.documentai.v1beta3.Document.Page.Table.TableRow\x12P\n\tbody_rows\x18\x03 \x03(\x0b\x32=.google.cloud.documentai.v1beta3.Document.Page.Table.TableRow\x12[\n\x12\x64\x65tected_languages\x18\x04 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x1aY\n\x08TableRow\x12M\n\x05\x63\x65lls\x18\x01 \x03(\x0b\x32>.google.cloud.documentai.v1beta3.Document.Page.Table.TableCell\x1a\xd3\x01\n\tTableCell\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12\x10\n\x08row_span\x18\x02 \x01(\x05\x12\x10\n\x08\x63ol_span\x18\x03 \x01(\x05\x12[\n\x12\x64\x65tected_languages\x18\x04 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x1a\xfb\x02\n\tFormField\x12I\n\nfield_name\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12J\n\x0b\x66ield_value\x18\x02 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12`\n\x17name_detected_languages\x18\x03 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12\x61\n\x18value_detected_languages\x18\x04 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12\x12\n\nvalue_type\x18\x05 \x01(\t\x1a=\n\x10\x44\x65tectedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x1a\x87\x06\n\x06\x45ntity\x12I\n\x0btext_anchor\x18\x01 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.TextAnchor\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x14\n\x0cmention_text\x18\x03 \x01(\t\x12\x12\n\nmention_id\x18\x04 \x01(\t\x12\x17\n\nconfidence\x18\x05 \x01(\x02\x42\x03\xe0\x41\x01\x12N\n\x0bpage_anchor\x18\x06 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.PageAnchorB\x03\xe0\x41\x01\x12\n\n\x02id\x18\x07 \x01(\t\x12_\n\x10normalized_value\x18\t \x01(\x0b\x32@.google.cloud.documentai.v1beta3.Document.Entity.NormalizedValueB\x03\xe0\x41\x01\x12I\n\nproperties\x18\n \x03(\x0b\x32\x30.google.cloud.documentai.v1beta3.Document.EntityB\x03\xe0\x41\x01\x12M\n\nprovenance\x18\x0b \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.ProvenanceB\x03\xe0\x41\x01\x12\x15\n\x08redacted\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x1a\xf2\x01\n\x0fNormalizedValue\x12)\n\x0bmoney_value\x18\x02 \x01(\x0b\x32\x12.google.type.MoneyH\x00\x12\'\n\ndate_value\x18\x03 \x01(\x0b\x32\x11.google.type.DateH\x00\x12/\n\x0e\x64\x61tetime_value\x18\x04 \x01(\x0b\x32\x15.google.type.DateTimeH\x00\x12\x33\n\raddress_value\x18\x05 \x01(\x0b\x32\x1a.google.type.PostalAddressH\x00\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x02\x42\x12\n\x10structured_value\x1aI\n\x0e\x45ntityRelation\x12\x12\n\nsubject_id\x18\x01 \x01(\t\x12\x11\n\tobject_id\x18\x02 \x01(\t\x12\x10\n\x08relation\x18\x03 \x01(\t\x1a\xd2\x01\n\x0bTranslation\x12I\n\x0btext_anchor\x18\x01 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.TextAnchor\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x17\n\x0ftranslated_text\x18\x03 \x01(\t\x12H\n\nprovenance\x18\x04 \x03(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Provenance\x1a\xad\x01\n\nTextAnchor\x12W\n\rtext_segments\x18\x01 \x03(\x0b\x32@.google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\x1a\x35\n\x0bTextSegment\x12\x13\n\x0bstart_index\x18\x01 \x01(\x03\x12\x11\n\tend_index\x18\x02 \x01(\x03\x1a\xce\x03\n\nPageAnchor\x12O\n\tpage_refs\x18\x01 \x03(\x0b\x32<.google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef\x1a\xee\x02\n\x07PageRef\x12\x11\n\x04page\x18\x01 \x01(\x03\x42\x03\xe0\x41\x02\x12\x61\n\x0blayout_type\x18\x02 \x01(\x0e\x32G.google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutTypeB\x03\xe0\x41\x01\x12\x18\n\tlayout_id\x18\x03 \x01(\tB\x05\x18\x01\xe0\x41\x01\x12I\n\rbounding_poly\x18\x04 \x01(\x0b\x32-.google.cloud.documentai.v1beta3.BoundingPolyB\x03\xe0\x41\x01"\x87\x01\n\nLayoutType\x12\x1b\n\x17LAYOUT_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x42LOCK\x10\x01\x12\r\n\tPARAGRAPH\x10\x02\x12\x08\n\x04LINE\x10\x03\x12\t\n\x05TOKEN\x10\x04\x12\x12\n\x0eVISUAL_ELEMENT\x10\x05\x12\t\n\x05TABLE\x10\x06\x12\x0e\n\nFORM_FIELD\x10\x07\x1a\xec\x02\n\nProvenance\x12\x10\n\x08revision\x18\x01 \x01(\x05\x12\n\n\x02id\x18\x02 \x01(\x05\x12L\n\x07parents\x18\x03 \x03(\x0b\x32;.google.cloud.documentai.v1beta3.Document.Provenance.Parent\x12P\n\x04type\x18\x04 \x01(\x0e\x32\x42.google.cloud.documentai.v1beta3.Document.Provenance.OperationType\x1a&\n\x06Parent\x12\x10\n\x08revision\x18\x01 \x01(\x05\x12\n\n\x02id\x18\x02 \x01(\x05"x\n\rOperationType\x12\x1e\n\x1aOPERATION_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02\x12\x0b\n\x07REPLACE\x10\x03\x12\x12\n\x0e\x45VAL_REQUESTED\x10\x04\x12\x11\n\rEVAL_APPROVED\x10\x05\x1a\x92\x02\n\x08Revision\x12\x0f\n\x05\x61gent\x18\x04 \x01(\tH\x00\x12\x13\n\tprocessor\x18\x05 \x01(\tH\x00\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06parent\x18\x02 \x03(\x05\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12T\n\x0chuman_review\x18\x06 \x01(\x0b\x32>.google.cloud.documentai.v1beta3.Document.Revision.HumanReview\x1a\x33\n\x0bHumanReview\x12\r\n\x05state\x18\x01 \x01(\t\x12\x15\n\rstate_message\x18\x02 \x01(\tB\x08\n\x06source\x1a\xb7\x01\n\nTextChange\x12I\n\x0btext_anchor\x18\x01 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.TextAnchor\x12\x14\n\x0c\x63hanged_text\x18\x02 \x01(\t\x12H\n\nprovenance\x18\x03 \x03(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.ProvenanceB\x08\n\x06sourceB\xe9\x01\n#com.google.cloud.documentai.v1beta3B\rDocumentProtoP\x01ZIgoogle.golang.org/genproto/googleapis/cloud/documentai/v1beta3;documentai\xaa\x02\x1fGoogle.Cloud.DocumentAI.v1beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAi\\v1beta3\xea\x02!Google::Cloud::DocumentAI::masterb\x06proto3', + dependencies=[ + google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, + google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_geometry__pb2.DESCRIPTOR, + google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, + google_dot_rpc_dot_status__pb2.DESCRIPTOR, + google_dot_type_dot_color__pb2.DESCRIPTOR, + google_dot_type_dot_date__pb2.DESCRIPTOR, + google_dot_type_dot_datetime__pb2.DESCRIPTOR, + google_dot_type_dot_money__pb2.DESCRIPTOR, + google_dot_type_dot_postal__address__pb2.DESCRIPTOR, + google_dot_api_dot_annotations__pb2.DESCRIPTOR, + ], +) + + +_DOCUMENT_PAGE_LAYOUT_ORIENTATION = _descriptor.EnumDescriptor( + name="Orientation", + full_name="google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation", + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name="ORIENTATION_UNSPECIFIED", + index=0, + number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="PAGE_UP", + index=1, + number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="PAGE_RIGHT", + index=2, + number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="PAGE_DOWN", + index=3, + number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="PAGE_LEFT", + index=4, + number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + ], + containing_type=None, + serialized_options=None, + serialized_start=2923, + serialized_end=3024, +) +_sym_db.RegisterEnumDescriptor(_DOCUMENT_PAGE_LAYOUT_ORIENTATION) + +_DOCUMENT_PAGE_TOKEN_DETECTEDBREAK_TYPE = _descriptor.EnumDescriptor( + name="Type", + full_name="google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type", + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name="TYPE_UNSPECIFIED", + index=0, + number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="SPACE", + index=1, + number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="WIDE_SPACE", + index=2, + number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="HYPHEN", + index=3, + number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + ], + containing_type=None, + serialized_options=None, + serialized_start=4218, + serialized_end=4285, +) +_sym_db.RegisterEnumDescriptor(_DOCUMENT_PAGE_TOKEN_DETECTEDBREAK_TYPE) + +_DOCUMENT_PAGEANCHOR_PAGEREF_LAYOUTTYPE = _descriptor.EnumDescriptor( + name="LayoutType", + full_name="google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType", + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name="LAYOUT_TYPE_UNSPECIFIED", + index=0, + number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="BLOCK", + index=1, + number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="PARAGRAPH", + index=2, + number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="LINE", + index=3, + number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="TOKEN", + index=4, + number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="VISUAL_ELEMENT", + index=5, + number=5, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="TABLE", + index=6, + number=6, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="FORM_FIELD", + index=7, + number=7, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + ], + containing_type=None, + serialized_options=None, + serialized_start=7143, + serialized_end=7278, +) +_sym_db.RegisterEnumDescriptor(_DOCUMENT_PAGEANCHOR_PAGEREF_LAYOUTTYPE) + +_DOCUMENT_PROVENANCE_OPERATIONTYPE = _descriptor.EnumDescriptor( + name="OperationType", + full_name="google.cloud.documentai.v1beta3.Document.Provenance.OperationType", + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name="OPERATION_TYPE_UNSPECIFIED", + index=0, + number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="ADD", + index=1, + number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="REMOVE", + index=2, + number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="REPLACE", + index=3, + number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="EVAL_REQUESTED", + index=4, + number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="EVAL_APPROVED", + index=5, + number=5, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + ], + containing_type=None, + serialized_options=None, + serialized_start=7525, + serialized_end=7645, +) +_sym_db.RegisterEnumDescriptor(_DOCUMENT_PROVENANCE_OPERATIONTYPE) + + +_DOCUMENT_SHARDINFO = _descriptor.Descriptor( + name="ShardInfo", + full_name="google.cloud.documentai.v1beta3.Document.ShardInfo", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="shard_index", + full_name="google.cloud.documentai.v1beta3.Document.ShardInfo.shard_index", + index=0, + number=1, + type=3, + cpp_type=2, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="shard_count", + full_name="google.cloud.documentai.v1beta3.Document.ShardInfo.shard_count", + index=1, + number=2, + type=3, + cpp_type=2, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="text_offset", + full_name="google.cloud.documentai.v1beta3.Document.ShardInfo.text_offset", + index=2, + number=3, + type=3, + cpp_type=2, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1097, + serialized_end=1171, +) + +_DOCUMENT_STYLE_FONTSIZE = _descriptor.Descriptor( + name="FontSize", + full_name="google.cloud.documentai.v1beta3.Document.Style.FontSize", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="size", + full_name="google.cloud.documentai.v1beta3.Document.Style.FontSize.size", + index=0, + number=1, + type=2, + cpp_type=6, + label=1, + has_default_value=False, + default_value=float(0), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="unit", + full_name="google.cloud.documentai.v1beta3.Document.Style.FontSize.unit", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1482, + serialized_end=1520, +) + +_DOCUMENT_STYLE = _descriptor.Descriptor( + name="Style", + full_name="google.cloud.documentai.v1beta3.Document.Style", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="text_anchor", + full_name="google.cloud.documentai.v1beta3.Document.Style.text_anchor", + index=0, + number=1, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="color", + full_name="google.cloud.documentai.v1beta3.Document.Style.color", + index=1, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="background_color", + full_name="google.cloud.documentai.v1beta3.Document.Style.background_color", + index=2, + number=3, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="font_weight", + full_name="google.cloud.documentai.v1beta3.Document.Style.font_weight", + index=3, + number=4, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="text_style", + full_name="google.cloud.documentai.v1beta3.Document.Style.text_style", + index=4, + number=5, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="text_decoration", + full_name="google.cloud.documentai.v1beta3.Document.Style.text_decoration", + index=5, + number=6, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="font_size", + full_name="google.cloud.documentai.v1beta3.Document.Style.font_size", + index=6, + number=7, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[_DOCUMENT_STYLE_FONTSIZE,], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1174, + serialized_end=1520, +) + +_DOCUMENT_PAGE_DIMENSION = _descriptor.Descriptor( + name="Dimension", + full_name="google.cloud.documentai.v1beta3.Document.Page.Dimension", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="width", + full_name="google.cloud.documentai.v1beta3.Document.Page.Dimension.width", + index=0, + number=1, + type=2, + cpp_type=6, + label=1, + has_default_value=False, + default_value=float(0), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="height", + full_name="google.cloud.documentai.v1beta3.Document.Page.Dimension.height", + index=1, + number=2, + type=2, + cpp_type=6, + label=1, + has_default_value=False, + default_value=float(0), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="unit", + full_name="google.cloud.documentai.v1beta3.Document.Page.Dimension.unit", + index=2, + number=3, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=2459, + serialized_end=2515, +) + +_DOCUMENT_PAGE_IMAGE = _descriptor.Descriptor( + name="Image", + full_name="google.cloud.documentai.v1beta3.Document.Page.Image", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="content", + full_name="google.cloud.documentai.v1beta3.Document.Page.Image.content", + index=0, + number=1, + type=12, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"", + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="mime_type", + full_name="google.cloud.documentai.v1beta3.Document.Page.Image.mime_type", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="width", + full_name="google.cloud.documentai.v1beta3.Document.Page.Image.width", + index=2, + number=3, + type=5, + cpp_type=1, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="height", + full_name="google.cloud.documentai.v1beta3.Document.Page.Image.height", + index=3, + number=4, + type=5, + cpp_type=1, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=2517, + serialized_end=2591, +) + +_DOCUMENT_PAGE_MATRIX = _descriptor.Descriptor( + name="Matrix", + full_name="google.cloud.documentai.v1beta3.Document.Page.Matrix", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="rows", + full_name="google.cloud.documentai.v1beta3.Document.Page.Matrix.rows", + index=0, + number=1, + type=5, + cpp_type=1, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="cols", + full_name="google.cloud.documentai.v1beta3.Document.Page.Matrix.cols", + index=1, + number=2, + type=5, + cpp_type=1, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="type", + full_name="google.cloud.documentai.v1beta3.Document.Page.Matrix.type", + index=2, + number=3, + type=5, + cpp_type=1, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="data", + full_name="google.cloud.documentai.v1beta3.Document.Page.Matrix.data", + index=3, + number=4, + type=12, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"", + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=2593, + serialized_end=2657, +) + +_DOCUMENT_PAGE_LAYOUT = _descriptor.Descriptor( + name="Layout", + full_name="google.cloud.documentai.v1beta3.Document.Page.Layout", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="text_anchor", + full_name="google.cloud.documentai.v1beta3.Document.Page.Layout.text_anchor", + index=0, + number=1, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="confidence", + full_name="google.cloud.documentai.v1beta3.Document.Page.Layout.confidence", + index=1, + number=2, + type=2, + cpp_type=6, + label=1, + has_default_value=False, + default_value=float(0), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="bounding_poly", + full_name="google.cloud.documentai.v1beta3.Document.Page.Layout.bounding_poly", + index=2, + number=3, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="orientation", + full_name="google.cloud.documentai.v1beta3.Document.Page.Layout.orientation", + index=3, + number=4, + type=14, + cpp_type=8, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[_DOCUMENT_PAGE_LAYOUT_ORIENTATION,], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=2660, + serialized_end=3024, +) + +_DOCUMENT_PAGE_BLOCK = _descriptor.Descriptor( + name="Block", + full_name="google.cloud.documentai.v1beta3.Document.Page.Block", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="layout", + full_name="google.cloud.documentai.v1beta3.Document.Page.Block.layout", + index=0, + number=1, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="detected_languages", + full_name="google.cloud.documentai.v1beta3.Document.Page.Block.detected_languages", + index=1, + number=2, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="provenance", + full_name="google.cloud.documentai.v1beta3.Document.Page.Block.provenance", + index=2, + number=3, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3027, + serialized_end=3272, +) + +_DOCUMENT_PAGE_PARAGRAPH = _descriptor.Descriptor( + name="Paragraph", + full_name="google.cloud.documentai.v1beta3.Document.Page.Paragraph", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="layout", + full_name="google.cloud.documentai.v1beta3.Document.Page.Paragraph.layout", + index=0, + number=1, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="detected_languages", + full_name="google.cloud.documentai.v1beta3.Document.Page.Paragraph.detected_languages", + index=1, + number=2, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="provenance", + full_name="google.cloud.documentai.v1beta3.Document.Page.Paragraph.provenance", + index=2, + number=3, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3275, + serialized_end=3524, +) + +_DOCUMENT_PAGE_LINE = _descriptor.Descriptor( + name="Line", + full_name="google.cloud.documentai.v1beta3.Document.Page.Line", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="layout", + full_name="google.cloud.documentai.v1beta3.Document.Page.Line.layout", + index=0, + number=1, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="detected_languages", + full_name="google.cloud.documentai.v1beta3.Document.Page.Line.detected_languages", + index=1, + number=2, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="provenance", + full_name="google.cloud.documentai.v1beta3.Document.Page.Line.provenance", + index=2, + number=3, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3527, + serialized_end=3771, +) + +_DOCUMENT_PAGE_TOKEN_DETECTEDBREAK = _descriptor.Descriptor( + name="DetectedBreak", + full_name="google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="type", + full_name="google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.type", + index=0, + number=1, + type=14, + cpp_type=8, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[_DOCUMENT_PAGE_TOKEN_DETECTEDBREAK_TYPE,], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=4114, + serialized_end=4285, +) + +_DOCUMENT_PAGE_TOKEN = _descriptor.Descriptor( + name="Token", + full_name="google.cloud.documentai.v1beta3.Document.Page.Token", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="layout", + full_name="google.cloud.documentai.v1beta3.Document.Page.Token.layout", + index=0, + number=1, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="detected_break", + full_name="google.cloud.documentai.v1beta3.Document.Page.Token.detected_break", + index=1, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="detected_languages", + full_name="google.cloud.documentai.v1beta3.Document.Page.Token.detected_languages", + index=2, + number=3, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="provenance", + full_name="google.cloud.documentai.v1beta3.Document.Page.Token.provenance", + index=3, + number=4, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[_DOCUMENT_PAGE_TOKEN_DETECTEDBREAK,], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3774, + serialized_end=4285, +) + +_DOCUMENT_PAGE_VISUALELEMENT = _descriptor.Descriptor( + name="VisualElement", + full_name="google.cloud.documentai.v1beta3.Document.Page.VisualElement", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="layout", + full_name="google.cloud.documentai.v1beta3.Document.Page.VisualElement.layout", + index=0, + number=1, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="type", + full_name="google.cloud.documentai.v1beta3.Document.Page.VisualElement.type", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="detected_languages", + full_name="google.cloud.documentai.v1beta3.Document.Page.VisualElement.detected_languages", + index=2, + number=3, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=4288, + serialized_end=4481, +) + +_DOCUMENT_PAGE_TABLE_TABLEROW = _descriptor.Descriptor( + name="TableRow", + full_name="google.cloud.documentai.v1beta3.Document.Page.Table.TableRow", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="cells", + full_name="google.cloud.documentai.v1beta3.Document.Page.Table.TableRow.cells", + index=0, + number=1, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=4823, + serialized_end=4912, +) + +_DOCUMENT_PAGE_TABLE_TABLECELL = _descriptor.Descriptor( + name="TableCell", + full_name="google.cloud.documentai.v1beta3.Document.Page.Table.TableCell", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="layout", + full_name="google.cloud.documentai.v1beta3.Document.Page.Table.TableCell.layout", + index=0, + number=1, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="row_span", + full_name="google.cloud.documentai.v1beta3.Document.Page.Table.TableCell.row_span", + index=1, + number=2, + type=5, + cpp_type=1, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="col_span", + full_name="google.cloud.documentai.v1beta3.Document.Page.Table.TableCell.col_span", + index=2, + number=3, + type=5, + cpp_type=1, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="detected_languages", + full_name="google.cloud.documentai.v1beta3.Document.Page.Table.TableCell.detected_languages", + index=3, + number=4, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=4915, + serialized_end=5126, +) + +_DOCUMENT_PAGE_TABLE = _descriptor.Descriptor( + name="Table", + full_name="google.cloud.documentai.v1beta3.Document.Page.Table", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="layout", + full_name="google.cloud.documentai.v1beta3.Document.Page.Table.layout", + index=0, + number=1, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="header_rows", + full_name="google.cloud.documentai.v1beta3.Document.Page.Table.header_rows", + index=1, + number=2, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="body_rows", + full_name="google.cloud.documentai.v1beta3.Document.Page.Table.body_rows", + index=2, + number=3, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="detected_languages", + full_name="google.cloud.documentai.v1beta3.Document.Page.Table.detected_languages", + index=3, + number=4, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[_DOCUMENT_PAGE_TABLE_TABLEROW, _DOCUMENT_PAGE_TABLE_TABLECELL,], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=4484, + serialized_end=5126, +) + +_DOCUMENT_PAGE_FORMFIELD = _descriptor.Descriptor( + name="FormField", + full_name="google.cloud.documentai.v1beta3.Document.Page.FormField", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="field_name", + full_name="google.cloud.documentai.v1beta3.Document.Page.FormField.field_name", + index=0, + number=1, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="field_value", + full_name="google.cloud.documentai.v1beta3.Document.Page.FormField.field_value", + index=1, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="name_detected_languages", + full_name="google.cloud.documentai.v1beta3.Document.Page.FormField.name_detected_languages", + index=2, + number=3, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="value_detected_languages", + full_name="google.cloud.documentai.v1beta3.Document.Page.FormField.value_detected_languages", + index=3, + number=4, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="value_type", + full_name="google.cloud.documentai.v1beta3.Document.Page.FormField.value_type", + index=4, + number=5, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=5129, + serialized_end=5508, +) + +_DOCUMENT_PAGE_DETECTEDLANGUAGE = _descriptor.Descriptor( + name="DetectedLanguage", + full_name="google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="language_code", + full_name="google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage.language_code", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="confidence", + full_name="google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage.confidence", + index=1, + number=2, + type=2, + cpp_type=6, + label=1, + has_default_value=False, + default_value=float(0), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=5510, + serialized_end=5571, +) + +_DOCUMENT_PAGE = _descriptor.Descriptor( + name="Page", + full_name="google.cloud.documentai.v1beta3.Document.Page", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="page_number", + full_name="google.cloud.documentai.v1beta3.Document.Page.page_number", + index=0, + number=1, + type=5, + cpp_type=1, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="image", + full_name="google.cloud.documentai.v1beta3.Document.Page.image", + index=1, + number=13, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="transforms", + full_name="google.cloud.documentai.v1beta3.Document.Page.transforms", + index=2, + number=14, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="dimension", + full_name="google.cloud.documentai.v1beta3.Document.Page.dimension", + index=3, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="layout", + full_name="google.cloud.documentai.v1beta3.Document.Page.layout", + index=4, + number=3, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="detected_languages", + full_name="google.cloud.documentai.v1beta3.Document.Page.detected_languages", + index=5, + number=4, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="blocks", + full_name="google.cloud.documentai.v1beta3.Document.Page.blocks", + index=6, + number=5, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="paragraphs", + full_name="google.cloud.documentai.v1beta3.Document.Page.paragraphs", + index=7, + number=6, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="lines", + full_name="google.cloud.documentai.v1beta3.Document.Page.lines", + index=8, + number=7, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="tokens", + full_name="google.cloud.documentai.v1beta3.Document.Page.tokens", + index=9, + number=8, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="visual_elements", + full_name="google.cloud.documentai.v1beta3.Document.Page.visual_elements", + index=10, + number=9, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="tables", + full_name="google.cloud.documentai.v1beta3.Document.Page.tables", + index=11, + number=10, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="form_fields", + full_name="google.cloud.documentai.v1beta3.Document.Page.form_fields", + index=12, + number=11, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[ + _DOCUMENT_PAGE_DIMENSION, + _DOCUMENT_PAGE_IMAGE, + _DOCUMENT_PAGE_MATRIX, + _DOCUMENT_PAGE_LAYOUT, + _DOCUMENT_PAGE_BLOCK, + _DOCUMENT_PAGE_PARAGRAPH, + _DOCUMENT_PAGE_LINE, + _DOCUMENT_PAGE_TOKEN, + _DOCUMENT_PAGE_VISUALELEMENT, + _DOCUMENT_PAGE_TABLE, + _DOCUMENT_PAGE_FORMFIELD, + _DOCUMENT_PAGE_DETECTEDLANGUAGE, + ], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1523, + serialized_end=5571, +) + +_DOCUMENT_ENTITY_NORMALIZEDVALUE = _descriptor.Descriptor( + name="NormalizedValue", + full_name="google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="money_value", + full_name="google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue.money_value", + index=0, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="date_value", + full_name="google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue.date_value", + index=1, + number=3, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="datetime_value", + full_name="google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue.datetime_value", + index=2, + number=4, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="address_value", + full_name="google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue.address_value", + index=3, + number=5, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="text", + full_name="google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue.text", + index=4, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\340A\002", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="structured_value", + full_name="google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue.structured_value", + index=0, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[], + ), + ], + serialized_start=6107, + serialized_end=6349, +) + +_DOCUMENT_ENTITY = _descriptor.Descriptor( + name="Entity", + full_name="google.cloud.documentai.v1beta3.Document.Entity", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="text_anchor", + full_name="google.cloud.documentai.v1beta3.Document.Entity.text_anchor", + index=0, + number=1, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="type", + full_name="google.cloud.documentai.v1beta3.Document.Entity.type", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="mention_text", + full_name="google.cloud.documentai.v1beta3.Document.Entity.mention_text", + index=2, + number=3, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="mention_id", + full_name="google.cloud.documentai.v1beta3.Document.Entity.mention_id", + index=3, + number=4, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="confidence", + full_name="google.cloud.documentai.v1beta3.Document.Entity.confidence", + index=4, + number=5, + type=2, + cpp_type=6, + label=1, + has_default_value=False, + default_value=float(0), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\340A\001", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="page_anchor", + full_name="google.cloud.documentai.v1beta3.Document.Entity.page_anchor", + index=5, + number=6, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\340A\001", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="id", + full_name="google.cloud.documentai.v1beta3.Document.Entity.id", + index=6, + number=7, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="normalized_value", + full_name="google.cloud.documentai.v1beta3.Document.Entity.normalized_value", + index=7, + number=9, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\340A\001", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="properties", + full_name="google.cloud.documentai.v1beta3.Document.Entity.properties", + index=8, + number=10, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\340A\001", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="provenance", + full_name="google.cloud.documentai.v1beta3.Document.Entity.provenance", + index=9, + number=11, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\340A\001", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="redacted", + full_name="google.cloud.documentai.v1beta3.Document.Entity.redacted", + index=10, + number=12, + type=8, + cpp_type=7, + label=1, + has_default_value=False, + default_value=False, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\340A\001", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[_DOCUMENT_ENTITY_NORMALIZEDVALUE,], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=5574, + serialized_end=6349, +) + +_DOCUMENT_ENTITYRELATION = _descriptor.Descriptor( + name="EntityRelation", + full_name="google.cloud.documentai.v1beta3.Document.EntityRelation", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="subject_id", + full_name="google.cloud.documentai.v1beta3.Document.EntityRelation.subject_id", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="object_id", + full_name="google.cloud.documentai.v1beta3.Document.EntityRelation.object_id", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="relation", + full_name="google.cloud.documentai.v1beta3.Document.EntityRelation.relation", + index=2, + number=3, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=6351, + serialized_end=6424, +) + +_DOCUMENT_TRANSLATION = _descriptor.Descriptor( + name="Translation", + full_name="google.cloud.documentai.v1beta3.Document.Translation", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="text_anchor", + full_name="google.cloud.documentai.v1beta3.Document.Translation.text_anchor", + index=0, + number=1, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="language_code", + full_name="google.cloud.documentai.v1beta3.Document.Translation.language_code", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="translated_text", + full_name="google.cloud.documentai.v1beta3.Document.Translation.translated_text", + index=2, + number=3, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="provenance", + full_name="google.cloud.documentai.v1beta3.Document.Translation.provenance", + index=3, + number=4, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=6427, + serialized_end=6637, +) + +_DOCUMENT_TEXTANCHOR_TEXTSEGMENT = _descriptor.Descriptor( + name="TextSegment", + full_name="google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="start_index", + full_name="google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment.start_index", + index=0, + number=1, + type=3, + cpp_type=2, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="end_index", + full_name="google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment.end_index", + index=1, + number=2, + type=3, + cpp_type=2, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=6760, + serialized_end=6813, +) + +_DOCUMENT_TEXTANCHOR = _descriptor.Descriptor( + name="TextAnchor", + full_name="google.cloud.documentai.v1beta3.Document.TextAnchor", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="text_segments", + full_name="google.cloud.documentai.v1beta3.Document.TextAnchor.text_segments", + index=0, + number=1, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="content", + full_name="google.cloud.documentai.v1beta3.Document.TextAnchor.content", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[_DOCUMENT_TEXTANCHOR_TEXTSEGMENT,], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=6640, + serialized_end=6813, +) + +_DOCUMENT_PAGEANCHOR_PAGEREF = _descriptor.Descriptor( + name="PageRef", + full_name="google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="page", + full_name="google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.page", + index=0, + number=1, + type=3, + cpp_type=2, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\340A\002", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="layout_type", + full_name="google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.layout_type", + index=1, + number=2, + type=14, + cpp_type=8, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\340A\001", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="layout_id", + full_name="google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.layout_id", + index=2, + number=3, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\030\001\340A\001", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="bounding_poly", + full_name="google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly", + index=3, + number=4, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\340A\001", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[_DOCUMENT_PAGEANCHOR_PAGEREF_LAYOUTTYPE,], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=6912, + serialized_end=7278, +) + +_DOCUMENT_PAGEANCHOR = _descriptor.Descriptor( + name="PageAnchor", + full_name="google.cloud.documentai.v1beta3.Document.PageAnchor", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="page_refs", + full_name="google.cloud.documentai.v1beta3.Document.PageAnchor.page_refs", + index=0, + number=1, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[_DOCUMENT_PAGEANCHOR_PAGEREF,], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=6816, + serialized_end=7278, +) + +_DOCUMENT_PROVENANCE_PARENT = _descriptor.Descriptor( + name="Parent", + full_name="google.cloud.documentai.v1beta3.Document.Provenance.Parent", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="revision", + full_name="google.cloud.documentai.v1beta3.Document.Provenance.Parent.revision", + index=0, + number=1, + type=5, + cpp_type=1, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="id", + full_name="google.cloud.documentai.v1beta3.Document.Provenance.Parent.id", + index=1, + number=2, + type=5, + cpp_type=1, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=7485, + serialized_end=7523, +) + +_DOCUMENT_PROVENANCE = _descriptor.Descriptor( + name="Provenance", + full_name="google.cloud.documentai.v1beta3.Document.Provenance", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="revision", + full_name="google.cloud.documentai.v1beta3.Document.Provenance.revision", + index=0, + number=1, + type=5, + cpp_type=1, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="id", + full_name="google.cloud.documentai.v1beta3.Document.Provenance.id", + index=1, + number=2, + type=5, + cpp_type=1, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="parents", + full_name="google.cloud.documentai.v1beta3.Document.Provenance.parents", + index=2, + number=3, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="type", + full_name="google.cloud.documentai.v1beta3.Document.Provenance.type", + index=3, + number=4, + type=14, + cpp_type=8, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[_DOCUMENT_PROVENANCE_PARENT,], + enum_types=[_DOCUMENT_PROVENANCE_OPERATIONTYPE,], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=7281, + serialized_end=7645, +) + +_DOCUMENT_REVISION_HUMANREVIEW = _descriptor.Descriptor( + name="HumanReview", + full_name="google.cloud.documentai.v1beta3.Document.Revision.HumanReview", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="state", + full_name="google.cloud.documentai.v1beta3.Document.Revision.HumanReview.state", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="state_message", + full_name="google.cloud.documentai.v1beta3.Document.Revision.HumanReview.state_message", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=7861, + serialized_end=7912, +) + +_DOCUMENT_REVISION = _descriptor.Descriptor( + name="Revision", + full_name="google.cloud.documentai.v1beta3.Document.Revision", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="agent", + full_name="google.cloud.documentai.v1beta3.Document.Revision.agent", + index=0, + number=4, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="processor", + full_name="google.cloud.documentai.v1beta3.Document.Revision.processor", + index=1, + number=5, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="id", + full_name="google.cloud.documentai.v1beta3.Document.Revision.id", + index=2, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="parent", + full_name="google.cloud.documentai.v1beta3.Document.Revision.parent", + index=3, + number=2, + type=5, + cpp_type=1, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="create_time", + full_name="google.cloud.documentai.v1beta3.Document.Revision.create_time", + index=4, + number=3, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="human_review", + full_name="google.cloud.documentai.v1beta3.Document.Revision.human_review", + index=5, + number=6, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[_DOCUMENT_REVISION_HUMANREVIEW,], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="source", + full_name="google.cloud.documentai.v1beta3.Document.Revision.source", + index=0, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[], + ), + ], + serialized_start=7648, + serialized_end=7922, +) + +_DOCUMENT_TEXTCHANGE = _descriptor.Descriptor( + name="TextChange", + full_name="google.cloud.documentai.v1beta3.Document.TextChange", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="text_anchor", + full_name="google.cloud.documentai.v1beta3.Document.TextChange.text_anchor", + index=0, + number=1, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="changed_text", + full_name="google.cloud.documentai.v1beta3.Document.TextChange.changed_text", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="provenance", + full_name="google.cloud.documentai.v1beta3.Document.TextChange.provenance", + index=2, + number=3, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=7925, + serialized_end=8108, +) + +_DOCUMENT = _descriptor.Descriptor( + name="Document", + full_name="google.cloud.documentai.v1beta3.Document", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="uri", + full_name="google.cloud.documentai.v1beta3.Document.uri", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="content", + full_name="google.cloud.documentai.v1beta3.Document.content", + index=1, + number=2, + type=12, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"", + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="mime_type", + full_name="google.cloud.documentai.v1beta3.Document.mime_type", + index=2, + number=3, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="text", + full_name="google.cloud.documentai.v1beta3.Document.text", + index=3, + number=4, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="text_styles", + full_name="google.cloud.documentai.v1beta3.Document.text_styles", + index=4, + number=5, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="pages", + full_name="google.cloud.documentai.v1beta3.Document.pages", + index=5, + number=6, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="entities", + full_name="google.cloud.documentai.v1beta3.Document.entities", + index=6, + number=7, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="entity_relations", + full_name="google.cloud.documentai.v1beta3.Document.entity_relations", + index=7, + number=8, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="translations", + full_name="google.cloud.documentai.v1beta3.Document.translations", + index=8, + number=12, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="text_changes", + full_name="google.cloud.documentai.v1beta3.Document.text_changes", + index=9, + number=14, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="shard_info", + full_name="google.cloud.documentai.v1beta3.Document.shard_info", + index=10, + number=9, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="error", + full_name="google.cloud.documentai.v1beta3.Document.error", + index=11, + number=10, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="revisions", + full_name="google.cloud.documentai.v1beta3.Document.revisions", + index=12, + number=13, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[ + _DOCUMENT_SHARDINFO, + _DOCUMENT_STYLE, + _DOCUMENT_PAGE, + _DOCUMENT_ENTITY, + _DOCUMENT_ENTITYRELATION, + _DOCUMENT_TRANSLATION, + _DOCUMENT_TEXTANCHOR, + _DOCUMENT_PAGEANCHOR, + _DOCUMENT_PROVENANCE, + _DOCUMENT_REVISION, + _DOCUMENT_TEXTCHANGE, + ], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="source", + full_name="google.cloud.documentai.v1beta3.Document.source", + index=0, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[], + ), + ], + serialized_start=401, + serialized_end=8118, +) + +_DOCUMENT_SHARDINFO.containing_type = _DOCUMENT +_DOCUMENT_STYLE_FONTSIZE.containing_type = _DOCUMENT_STYLE +_DOCUMENT_STYLE.fields_by_name["text_anchor"].message_type = _DOCUMENT_TEXTANCHOR +_DOCUMENT_STYLE.fields_by_name[ + "color" +].message_type = google_dot_type_dot_color__pb2._COLOR +_DOCUMENT_STYLE.fields_by_name[ + "background_color" +].message_type = google_dot_type_dot_color__pb2._COLOR +_DOCUMENT_STYLE.fields_by_name["font_size"].message_type = _DOCUMENT_STYLE_FONTSIZE +_DOCUMENT_STYLE.containing_type = _DOCUMENT +_DOCUMENT_PAGE_DIMENSION.containing_type = _DOCUMENT_PAGE +_DOCUMENT_PAGE_IMAGE.containing_type = _DOCUMENT_PAGE +_DOCUMENT_PAGE_MATRIX.containing_type = _DOCUMENT_PAGE +_DOCUMENT_PAGE_LAYOUT.fields_by_name["text_anchor"].message_type = _DOCUMENT_TEXTANCHOR +_DOCUMENT_PAGE_LAYOUT.fields_by_name[ + "bounding_poly" +].message_type = ( + google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_geometry__pb2._BOUNDINGPOLY +) +_DOCUMENT_PAGE_LAYOUT.fields_by_name[ + "orientation" +].enum_type = _DOCUMENT_PAGE_LAYOUT_ORIENTATION +_DOCUMENT_PAGE_LAYOUT.containing_type = _DOCUMENT_PAGE +_DOCUMENT_PAGE_LAYOUT_ORIENTATION.containing_type = _DOCUMENT_PAGE_LAYOUT +_DOCUMENT_PAGE_BLOCK.fields_by_name["layout"].message_type = _DOCUMENT_PAGE_LAYOUT +_DOCUMENT_PAGE_BLOCK.fields_by_name[ + "detected_languages" +].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE +_DOCUMENT_PAGE_BLOCK.fields_by_name["provenance"].message_type = _DOCUMENT_PROVENANCE +_DOCUMENT_PAGE_BLOCK.containing_type = _DOCUMENT_PAGE +_DOCUMENT_PAGE_PARAGRAPH.fields_by_name["layout"].message_type = _DOCUMENT_PAGE_LAYOUT +_DOCUMENT_PAGE_PARAGRAPH.fields_by_name[ + "detected_languages" +].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE +_DOCUMENT_PAGE_PARAGRAPH.fields_by_name[ + "provenance" +].message_type = _DOCUMENT_PROVENANCE +_DOCUMENT_PAGE_PARAGRAPH.containing_type = _DOCUMENT_PAGE +_DOCUMENT_PAGE_LINE.fields_by_name["layout"].message_type = _DOCUMENT_PAGE_LAYOUT +_DOCUMENT_PAGE_LINE.fields_by_name[ + "detected_languages" +].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE +_DOCUMENT_PAGE_LINE.fields_by_name["provenance"].message_type = _DOCUMENT_PROVENANCE +_DOCUMENT_PAGE_LINE.containing_type = _DOCUMENT_PAGE +_DOCUMENT_PAGE_TOKEN_DETECTEDBREAK.fields_by_name[ + "type" +].enum_type = _DOCUMENT_PAGE_TOKEN_DETECTEDBREAK_TYPE +_DOCUMENT_PAGE_TOKEN_DETECTEDBREAK.containing_type = _DOCUMENT_PAGE_TOKEN +_DOCUMENT_PAGE_TOKEN_DETECTEDBREAK_TYPE.containing_type = ( + _DOCUMENT_PAGE_TOKEN_DETECTEDBREAK +) +_DOCUMENT_PAGE_TOKEN.fields_by_name["layout"].message_type = _DOCUMENT_PAGE_LAYOUT +_DOCUMENT_PAGE_TOKEN.fields_by_name[ + "detected_break" +].message_type = _DOCUMENT_PAGE_TOKEN_DETECTEDBREAK +_DOCUMENT_PAGE_TOKEN.fields_by_name[ + "detected_languages" +].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE +_DOCUMENT_PAGE_TOKEN.fields_by_name["provenance"].message_type = _DOCUMENT_PROVENANCE +_DOCUMENT_PAGE_TOKEN.containing_type = _DOCUMENT_PAGE +_DOCUMENT_PAGE_VISUALELEMENT.fields_by_name[ + "layout" +].message_type = _DOCUMENT_PAGE_LAYOUT +_DOCUMENT_PAGE_VISUALELEMENT.fields_by_name[ + "detected_languages" +].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE +_DOCUMENT_PAGE_VISUALELEMENT.containing_type = _DOCUMENT_PAGE +_DOCUMENT_PAGE_TABLE_TABLEROW.fields_by_name[ + "cells" +].message_type = _DOCUMENT_PAGE_TABLE_TABLECELL +_DOCUMENT_PAGE_TABLE_TABLEROW.containing_type = _DOCUMENT_PAGE_TABLE +_DOCUMENT_PAGE_TABLE_TABLECELL.fields_by_name[ + "layout" +].message_type = _DOCUMENT_PAGE_LAYOUT +_DOCUMENT_PAGE_TABLE_TABLECELL.fields_by_name[ + "detected_languages" +].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE +_DOCUMENT_PAGE_TABLE_TABLECELL.containing_type = _DOCUMENT_PAGE_TABLE +_DOCUMENT_PAGE_TABLE.fields_by_name["layout"].message_type = _DOCUMENT_PAGE_LAYOUT +_DOCUMENT_PAGE_TABLE.fields_by_name[ + "header_rows" +].message_type = _DOCUMENT_PAGE_TABLE_TABLEROW +_DOCUMENT_PAGE_TABLE.fields_by_name[ + "body_rows" +].message_type = _DOCUMENT_PAGE_TABLE_TABLEROW +_DOCUMENT_PAGE_TABLE.fields_by_name[ + "detected_languages" +].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE +_DOCUMENT_PAGE_TABLE.containing_type = _DOCUMENT_PAGE +_DOCUMENT_PAGE_FORMFIELD.fields_by_name[ + "field_name" +].message_type = _DOCUMENT_PAGE_LAYOUT +_DOCUMENT_PAGE_FORMFIELD.fields_by_name[ + "field_value" +].message_type = _DOCUMENT_PAGE_LAYOUT +_DOCUMENT_PAGE_FORMFIELD.fields_by_name[ + "name_detected_languages" +].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE +_DOCUMENT_PAGE_FORMFIELD.fields_by_name[ + "value_detected_languages" +].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE +_DOCUMENT_PAGE_FORMFIELD.containing_type = _DOCUMENT_PAGE +_DOCUMENT_PAGE_DETECTEDLANGUAGE.containing_type = _DOCUMENT_PAGE +_DOCUMENT_PAGE.fields_by_name["image"].message_type = _DOCUMENT_PAGE_IMAGE +_DOCUMENT_PAGE.fields_by_name["transforms"].message_type = _DOCUMENT_PAGE_MATRIX +_DOCUMENT_PAGE.fields_by_name["dimension"].message_type = _DOCUMENT_PAGE_DIMENSION +_DOCUMENT_PAGE.fields_by_name["layout"].message_type = _DOCUMENT_PAGE_LAYOUT +_DOCUMENT_PAGE.fields_by_name[ + "detected_languages" +].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE +_DOCUMENT_PAGE.fields_by_name["blocks"].message_type = _DOCUMENT_PAGE_BLOCK +_DOCUMENT_PAGE.fields_by_name["paragraphs"].message_type = _DOCUMENT_PAGE_PARAGRAPH +_DOCUMENT_PAGE.fields_by_name["lines"].message_type = _DOCUMENT_PAGE_LINE +_DOCUMENT_PAGE.fields_by_name["tokens"].message_type = _DOCUMENT_PAGE_TOKEN +_DOCUMENT_PAGE.fields_by_name[ + "visual_elements" +].message_type = _DOCUMENT_PAGE_VISUALELEMENT +_DOCUMENT_PAGE.fields_by_name["tables"].message_type = _DOCUMENT_PAGE_TABLE +_DOCUMENT_PAGE.fields_by_name["form_fields"].message_type = _DOCUMENT_PAGE_FORMFIELD +_DOCUMENT_PAGE.containing_type = _DOCUMENT +_DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name[ + "money_value" +].message_type = google_dot_type_dot_money__pb2._MONEY +_DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name[ + "date_value" +].message_type = google_dot_type_dot_date__pb2._DATE +_DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name[ + "datetime_value" +].message_type = google_dot_type_dot_datetime__pb2._DATETIME +_DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name[ + "address_value" +].message_type = google_dot_type_dot_postal__address__pb2._POSTALADDRESS +_DOCUMENT_ENTITY_NORMALIZEDVALUE.containing_type = _DOCUMENT_ENTITY +_DOCUMENT_ENTITY_NORMALIZEDVALUE.oneofs_by_name["structured_value"].fields.append( + _DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name["money_value"] +) +_DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name[ + "money_value" +].containing_oneof = _DOCUMENT_ENTITY_NORMALIZEDVALUE.oneofs_by_name["structured_value"] +_DOCUMENT_ENTITY_NORMALIZEDVALUE.oneofs_by_name["structured_value"].fields.append( + _DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name["date_value"] +) +_DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name[ + "date_value" +].containing_oneof = _DOCUMENT_ENTITY_NORMALIZEDVALUE.oneofs_by_name["structured_value"] +_DOCUMENT_ENTITY_NORMALIZEDVALUE.oneofs_by_name["structured_value"].fields.append( + _DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name["datetime_value"] +) +_DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name[ + "datetime_value" +].containing_oneof = _DOCUMENT_ENTITY_NORMALIZEDVALUE.oneofs_by_name["structured_value"] +_DOCUMENT_ENTITY_NORMALIZEDVALUE.oneofs_by_name["structured_value"].fields.append( + _DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name["address_value"] +) +_DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name[ + "address_value" +].containing_oneof = _DOCUMENT_ENTITY_NORMALIZEDVALUE.oneofs_by_name["structured_value"] +_DOCUMENT_ENTITY.fields_by_name["text_anchor"].message_type = _DOCUMENT_TEXTANCHOR +_DOCUMENT_ENTITY.fields_by_name["page_anchor"].message_type = _DOCUMENT_PAGEANCHOR +_DOCUMENT_ENTITY.fields_by_name[ + "normalized_value" +].message_type = _DOCUMENT_ENTITY_NORMALIZEDVALUE +_DOCUMENT_ENTITY.fields_by_name["properties"].message_type = _DOCUMENT_ENTITY +_DOCUMENT_ENTITY.fields_by_name["provenance"].message_type = _DOCUMENT_PROVENANCE +_DOCUMENT_ENTITY.containing_type = _DOCUMENT +_DOCUMENT_ENTITYRELATION.containing_type = _DOCUMENT +_DOCUMENT_TRANSLATION.fields_by_name["text_anchor"].message_type = _DOCUMENT_TEXTANCHOR +_DOCUMENT_TRANSLATION.fields_by_name["provenance"].message_type = _DOCUMENT_PROVENANCE +_DOCUMENT_TRANSLATION.containing_type = _DOCUMENT +_DOCUMENT_TEXTANCHOR_TEXTSEGMENT.containing_type = _DOCUMENT_TEXTANCHOR +_DOCUMENT_TEXTANCHOR.fields_by_name[ + "text_segments" +].message_type = _DOCUMENT_TEXTANCHOR_TEXTSEGMENT +_DOCUMENT_TEXTANCHOR.containing_type = _DOCUMENT +_DOCUMENT_PAGEANCHOR_PAGEREF.fields_by_name[ + "layout_type" +].enum_type = _DOCUMENT_PAGEANCHOR_PAGEREF_LAYOUTTYPE +_DOCUMENT_PAGEANCHOR_PAGEREF.fields_by_name[ + "bounding_poly" +].message_type = ( + google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_geometry__pb2._BOUNDINGPOLY +) +_DOCUMENT_PAGEANCHOR_PAGEREF.containing_type = _DOCUMENT_PAGEANCHOR +_DOCUMENT_PAGEANCHOR_PAGEREF_LAYOUTTYPE.containing_type = _DOCUMENT_PAGEANCHOR_PAGEREF +_DOCUMENT_PAGEANCHOR.fields_by_name[ + "page_refs" +].message_type = _DOCUMENT_PAGEANCHOR_PAGEREF +_DOCUMENT_PAGEANCHOR.containing_type = _DOCUMENT +_DOCUMENT_PROVENANCE_PARENT.containing_type = _DOCUMENT_PROVENANCE +_DOCUMENT_PROVENANCE.fields_by_name[ + "parents" +].message_type = _DOCUMENT_PROVENANCE_PARENT +_DOCUMENT_PROVENANCE.fields_by_name[ + "type" +].enum_type = _DOCUMENT_PROVENANCE_OPERATIONTYPE +_DOCUMENT_PROVENANCE.containing_type = _DOCUMENT +_DOCUMENT_PROVENANCE_OPERATIONTYPE.containing_type = _DOCUMENT_PROVENANCE +_DOCUMENT_REVISION_HUMANREVIEW.containing_type = _DOCUMENT_REVISION +_DOCUMENT_REVISION.fields_by_name[ + "create_time" +].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP +_DOCUMENT_REVISION.fields_by_name[ + "human_review" +].message_type = _DOCUMENT_REVISION_HUMANREVIEW +_DOCUMENT_REVISION.containing_type = _DOCUMENT +_DOCUMENT_REVISION.oneofs_by_name["source"].fields.append( + _DOCUMENT_REVISION.fields_by_name["agent"] +) +_DOCUMENT_REVISION.fields_by_name[ + "agent" +].containing_oneof = _DOCUMENT_REVISION.oneofs_by_name["source"] +_DOCUMENT_REVISION.oneofs_by_name["source"].fields.append( + _DOCUMENT_REVISION.fields_by_name["processor"] +) +_DOCUMENT_REVISION.fields_by_name[ + "processor" +].containing_oneof = _DOCUMENT_REVISION.oneofs_by_name["source"] +_DOCUMENT_TEXTCHANGE.fields_by_name["text_anchor"].message_type = _DOCUMENT_TEXTANCHOR +_DOCUMENT_TEXTCHANGE.fields_by_name["provenance"].message_type = _DOCUMENT_PROVENANCE +_DOCUMENT_TEXTCHANGE.containing_type = _DOCUMENT +_DOCUMENT.fields_by_name["text_styles"].message_type = _DOCUMENT_STYLE +_DOCUMENT.fields_by_name["pages"].message_type = _DOCUMENT_PAGE +_DOCUMENT.fields_by_name["entities"].message_type = _DOCUMENT_ENTITY +_DOCUMENT.fields_by_name["entity_relations"].message_type = _DOCUMENT_ENTITYRELATION +_DOCUMENT.fields_by_name["translations"].message_type = _DOCUMENT_TRANSLATION +_DOCUMENT.fields_by_name["text_changes"].message_type = _DOCUMENT_TEXTCHANGE +_DOCUMENT.fields_by_name["shard_info"].message_type = _DOCUMENT_SHARDINFO +_DOCUMENT.fields_by_name["error"].message_type = google_dot_rpc_dot_status__pb2._STATUS +_DOCUMENT.fields_by_name["revisions"].message_type = _DOCUMENT_REVISION +_DOCUMENT.oneofs_by_name["source"].fields.append(_DOCUMENT.fields_by_name["uri"]) +_DOCUMENT.fields_by_name["uri"].containing_oneof = _DOCUMENT.oneofs_by_name["source"] +_DOCUMENT.oneofs_by_name["source"].fields.append(_DOCUMENT.fields_by_name["content"]) +_DOCUMENT.fields_by_name["content"].containing_oneof = _DOCUMENT.oneofs_by_name[ + "source" +] +DESCRIPTOR.message_types_by_name["Document"] = _DOCUMENT +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Document = _reflection.GeneratedProtocolMessageType( + "Document", + (_message.Message,), + { + "ShardInfo": _reflection.GeneratedProtocolMessageType( + "ShardInfo", + (_message.Message,), + { + "DESCRIPTOR": _DOCUMENT_SHARDINFO, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """For a large document, sharding may be performed to produce several + document shards. Each document shard contains this field to detail + which shard it is. + + Attributes: + shard_index: + The 0-based index of this shard. + shard_count: + Total number of shards. + text_offset: + The index of the first character in + [Document.text][google.cloud.documentai.v1beta3.Document.text] + in the overall document global text. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.ShardInfo) + }, + ), + "Style": _reflection.GeneratedProtocolMessageType( + "Style", + (_message.Message,), + { + "FontSize": _reflection.GeneratedProtocolMessageType( + "FontSize", + (_message.Message,), + { + "DESCRIPTOR": _DOCUMENT_STYLE_FONTSIZE, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """Font size with unit. + + Attributes: + size: + Font size for the text. + unit: + Unit for the font size. Follows CSS naming (in, px, pt, etc.). + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Style.FontSize) + }, + ), + "DESCRIPTOR": _DOCUMENT_STYLE, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """Annotation for common text style attributes. This adheres to CSS + conventions as much as possible. + + Attributes: + text_anchor: + Text anchor indexing into the [Document.text][google.cloud.doc + umentai.v1beta3.Document.text]. + color: + Text color. + background_color: + Text background color. + font_weight: + Font weight. Possible values are normal, bold, bolder, and + lighter. https://www.w3schools.com/cssref/pr_font_weight.asp + text_style: + Text style. Possible values are normal, italic, and oblique. + https://www.w3schools.com/cssref/pr_font_font-style.asp + text_decoration: + Text decoration. Follows CSS standard. + https://www.w3schools.com/cssref/pr_text_text-decoration.asp + font_size: + Font size. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Style) + }, + ), + "Page": _reflection.GeneratedProtocolMessageType( + "Page", + (_message.Message,), + { + "Dimension": _reflection.GeneratedProtocolMessageType( + "Dimension", + (_message.Message,), + { + "DESCRIPTOR": _DOCUMENT_PAGE_DIMENSION, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """Dimension for the page. + + Attributes: + width: + Page width. + height: + Page height. + unit: + Dimension unit. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.Dimension) + }, + ), + "Image": _reflection.GeneratedProtocolMessageType( + "Image", + (_message.Message,), + { + "DESCRIPTOR": _DOCUMENT_PAGE_IMAGE, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """Rendered image contents for this page. + + Attributes: + content: + Raw byte content of the image. + mime_type: + Encoding mime type for the image. + width: + Width of the image in pixels. + height: + Height of the image in pixels. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.Image) + }, + ), + "Matrix": _reflection.GeneratedProtocolMessageType( + "Matrix", + (_message.Message,), + { + "DESCRIPTOR": _DOCUMENT_PAGE_MATRIX, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """Representation for transformation matrix, intended to be compatible + and used with OpenCV format for image manipulation. + + Attributes: + rows: + Number of rows in the matrix. + cols: + Number of columns in the matrix. + type: + This encodes information about what data type the matrix uses. + For example, 0 (CV_8U) is an unsigned 8-bit image. For the + full list of OpenCV primitive data types, please refer to http + s://docs.opencv.org/4.3.0/d1/d1b/group__core__hal__interface.h + tml + data: + The matrix data. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.Matrix) + }, + ), + "Layout": _reflection.GeneratedProtocolMessageType( + "Layout", + (_message.Message,), + { + "DESCRIPTOR": _DOCUMENT_PAGE_LAYOUT, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """Visual element describing a layout unit on a page. + + Attributes: + text_anchor: + Text anchor indexing into the [Document.text][google.cloud.doc + umentai.v1beta3.Document.text]. + confidence: + Confidence of the current + [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] + within context of the object this layout is for. + e.g. confidence can be for a single token, a table, a visual + element, etc. depending on context. Range [0, 1]. + bounding_poly: + The bounding polygon for the [Layout][google.cloud.documentai. + v1beta3.Document.Page.Layout]. + orientation: + Detected orientation for the [Layout][google.cloud.documentai. + v1beta3.Document.Page.Layout]. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.Layout) + }, + ), + "Block": _reflection.GeneratedProtocolMessageType( + "Block", + (_message.Message,), + { + "DESCRIPTOR": _DOCUMENT_PAGE_BLOCK, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """A block has a set of lines (collected into paragraphs) that have a + common line-spacing and orientation. + + Attributes: + layout: + [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] + for + [Block][google.cloud.documentai.v1beta3.Document.Page.Block]. + detected_languages: + A list of detected languages together with confidence. + provenance: + The history of this annotation. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.Block) + }, + ), + "Paragraph": _reflection.GeneratedProtocolMessageType( + "Paragraph", + (_message.Message,), + { + "DESCRIPTOR": _DOCUMENT_PAGE_PARAGRAPH, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """A collection of lines that a human would perceive as a paragraph. + + Attributes: + layout: + [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] + for [Paragraph][google.cloud.documentai.v1beta3.Document.Page. + Paragraph]. + detected_languages: + A list of detected languages together with confidence. + provenance: + The history of this annotation. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.Paragraph) + }, + ), + "Line": _reflection.GeneratedProtocolMessageType( + "Line", + (_message.Message,), + { + "DESCRIPTOR": _DOCUMENT_PAGE_LINE, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """A collection of tokens that a human would perceive as a line. Does not + cross column boundaries, can be horizontal, vertical, etc. + + Attributes: + layout: + [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] + for + [Line][google.cloud.documentai.v1beta3.Document.Page.Line]. + detected_languages: + A list of detected languages together with confidence. + provenance: + The history of this annotation. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.Line) + }, + ), + "Token": _reflection.GeneratedProtocolMessageType( + "Token", + (_message.Message,), + { + "DetectedBreak": _reflection.GeneratedProtocolMessageType( + "DetectedBreak", + (_message.Message,), + { + "DESCRIPTOR": _DOCUMENT_PAGE_TOKEN_DETECTEDBREAK, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """Detected break at the end of a + [Token][google.cloud.documentai.v1beta3.Document.Page.Token]. + + Attributes: + type: + Detected break type. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak) + }, + ), + "DESCRIPTOR": _DOCUMENT_PAGE_TOKEN, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """A detected token. + + Attributes: + layout: + [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] + for + [Token][google.cloud.documentai.v1beta3.Document.Page.Token]. + detected_break: + Detected break at the end of a + [Token][google.cloud.documentai.v1beta3.Document.Page.Token]. + detected_languages: + A list of detected languages together with confidence. + provenance: + The history of this annotation. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.Token) + }, + ), + "VisualElement": _reflection.GeneratedProtocolMessageType( + "VisualElement", + (_message.Message,), + { + "DESCRIPTOR": _DOCUMENT_PAGE_VISUALELEMENT, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """Detected non-text visual elements e.g. checkbox, signature etc. on the + page. + + Attributes: + layout: + [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] + for [VisualElement][google.cloud.documentai.v1beta3.Document.P + age.VisualElement]. + type: + Type of the [VisualElement][google.cloud.documentai.v1beta3.Do + cument.Page.VisualElement]. + detected_languages: + A list of detected languages together with confidence. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.VisualElement) + }, + ), + "Table": _reflection.GeneratedProtocolMessageType( + "Table", + (_message.Message,), + { + "TableRow": _reflection.GeneratedProtocolMessageType( + "TableRow", + (_message.Message,), + { + "DESCRIPTOR": _DOCUMENT_PAGE_TABLE_TABLEROW, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """A row of table cells. + + Attributes: + cells: + Cells that make up this row. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.Table.TableRow) + }, + ), + "TableCell": _reflection.GeneratedProtocolMessageType( + "TableCell", + (_message.Message,), + { + "DESCRIPTOR": _DOCUMENT_PAGE_TABLE_TABLECELL, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """A cell representation inside the table. + + Attributes: + layout: + [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] + for [TableCell][google.cloud.documentai.v1beta3.Document.Page. + Table.TableCell]. + row_span: + How many rows this cell spans. + col_span: + How many columns this cell spans. + detected_languages: + A list of detected languages together with confidence. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.Table.TableCell) + }, + ), + "DESCRIPTOR": _DOCUMENT_PAGE_TABLE, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """A table representation similar to HTML table structure. + + Attributes: + layout: + [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] + for + [Table][google.cloud.documentai.v1beta3.Document.Page.Table]. + header_rows: + Header rows of the table. + body_rows: + Body rows of the table. + detected_languages: + A list of detected languages together with confidence. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.Table) + }, + ), + "FormField": _reflection.GeneratedProtocolMessageType( + "FormField", + (_message.Message,), + { + "DESCRIPTOR": _DOCUMENT_PAGE_FORMFIELD, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """A form field detected on the page. + + Attributes: + field_name: + [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] + for the [FormField][google.cloud.documentai.v1beta3.Document.P + age.FormField] name. e.g. ``Address``, ``Email``, ``Grand + total``, ``Phone number``, etc. + field_value: + [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] + for the [FormField][google.cloud.documentai.v1beta3.Document.P + age.FormField] value. + name_detected_languages: + A list of detected languages for name together with + confidence. + value_detected_languages: + A list of detected languages for value together with + confidence. + value_type: + If the value is non-textual, this field represents the type. + Current valid values are: - blank (this indicates the + field_value is normal text) - “unfilled_checkbox” - + “filled_checkbox” + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.FormField) + }, + ), + "DetectedLanguage": _reflection.GeneratedProtocolMessageType( + "DetectedLanguage", + (_message.Message,), + { + "DESCRIPTOR": _DOCUMENT_PAGE_DETECTEDLANGUAGE, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """Detected language for a structural component. + + Attributes: + language_code: + The BCP-47 language code, such as “en-US” or “sr-Latn”. For + more information, see http://www.unicode.org/reports/tr35/#Uni + code_locale_identifier. + confidence: + Confidence of detected language. Range [0, 1]. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage) + }, + ), + "DESCRIPTOR": _DOCUMENT_PAGE, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """A page in a [Document][google.cloud.documentai.v1beta3.Document]. + + Attributes: + page_number: + 1-based index for current + [Page][google.cloud.documentai.v1beta3.Document.Page] in a + parent [Document][google.cloud.documentai.v1beta3.Document]. + Useful when a page is taken out of a + [Document][google.cloud.documentai.v1beta3.Document] for + individual processing. + image: + Rendered image for this page. This image is preprocessed to + remove any skew, rotation, and distortions such that the + annotation bounding boxes can be upright and axis-aligned. + transforms: + Transformation matrices that were applied to the original + document image to produce [Page.image][google.cloud.documentai + .v1beta3.Document.Page.image]. + dimension: + Physical dimension of the page. + layout: + [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] + for the page. + detected_languages: + A list of detected languages together with confidence. + blocks: + A list of visually detected text blocks on the page. A block + has a set of lines (collected into paragraphs) that have a + common line-spacing and orientation. + paragraphs: + A list of visually detected text paragraphs on the page. A + collection of lines that a human would perceive as a + paragraph. + lines: + A list of visually detected text lines on the page. A + collection of tokens that a human would perceive as a line. + tokens: + A list of visually detected tokens on the page. + visual_elements: + A list of detected non-text visual elements e.g. checkbox, + signature etc. on the page. + tables: + A list of visually detected tables on the page. + form_fields: + A list of visually detected form fields on the page. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page) + }, + ), + "Entity": _reflection.GeneratedProtocolMessageType( + "Entity", + (_message.Message,), + { + "NormalizedValue": _reflection.GeneratedProtocolMessageType( + "NormalizedValue", + (_message.Message,), + { + "DESCRIPTOR": _DOCUMENT_ENTITY_NORMALIZEDVALUE, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """Parsed and normalized entity value. + + Attributes: + structured_value: + Structured entity value. Must match entity type defined in + schema if known. If this field is present, the ‘text’ field is + still populated. + money_value: + Money value. See also: https: github.com/googleapis/googleapi + s/blob/master/google/type/money.proto + date_value: + Date value. Includes year, month, day. See also: https: githu + b.com/googleapis/googleapis/blob/master/google/type/date.proto + datetime_value: + DateTime value. Includes date, time, and timezone. See also: + https: github.com/googleapis/googleapis/blob/master/google/typ + e/datetime.proto + address_value: + Postal address. See also: https: github.com/googleapis/google + apis/blob/master/google/type/postal_address.proto + text: + Required. Normalized entity value stored as a string. This + field is populated for supported document type (e.g. Invoice). + For some entity types, one of respective ‘structured_value’ + fields may also be populated. - Money/Currency type + (``money_value``) is in the ISO 4217 text format. - Date type + (``date_value``) is in the ISO 8601 text format. - Datetime + type (``datetime_value``) is in the ISO 8601 text format. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue) + }, + ), + "DESCRIPTOR": _DOCUMENT_ENTITY, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """A phrase in the text that is a known entity type, such as a person, an + organization, or location. + + Attributes: + text_anchor: + Provenance of the entity. Text anchor indexing into the [Docum + ent.text][google.cloud.documentai.v1beta3.Document.text]. + type: + Entity type from a schema e.g. ``Address``. + mention_text: + Text value in the document e.g. ``1600 Amphitheatre Pkwy``. + mention_id: + Deprecated. Use ``id`` field instead. + confidence: + Optional. Confidence of detected Schema entity. Range [0, 1]. + page_anchor: + Optional. Represents the provenance of this entity wrt. the + location on the page where it was found. + id: + Canonical id. This will be a unique value in the entity list + for this document. + normalized_value: + Optional. Normalized entity value. Absent if the extracted + value could not be converted or the type (e.g. address) is not + supported for certain parsers. This field is also only + populated for certain supported document types. + properties: + Optional. Entities can be nested to form a hierarchical data + structure representing the content in the document. + provenance: + Optional. The history of this annotation. + redacted: + Optional. Whether the entity will be redacted for de- + identification purposes. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Entity) + }, + ), + "EntityRelation": _reflection.GeneratedProtocolMessageType( + "EntityRelation", + (_message.Message,), + { + "DESCRIPTOR": _DOCUMENT_ENTITYRELATION, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """Relationship between + [Entities][google.cloud.documentai.v1beta3.Document.Entity]. + + Attributes: + subject_id: + Subject entity id. + object_id: + Object entity id. + relation: + Relationship description. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.EntityRelation) + }, + ), + "Translation": _reflection.GeneratedProtocolMessageType( + "Translation", + (_message.Message,), + { + "DESCRIPTOR": _DOCUMENT_TRANSLATION, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """A translation of the text segment. + + Attributes: + text_anchor: + Provenance of the translation. Text anchor indexing into the [ + Document.text][google.cloud.documentai.v1beta3.Document.text]. + There can only be a single ``TextAnchor.text_segments`` + element. If the start and end index of the text segment are + the same, the text change is inserted before that index. + language_code: + The BCP-47 language code, such as “en-US” or “sr-Latn”. For + more information, see http://www.unicode.org/reports/tr35/#Uni + code_locale_identifier. + translated_text: + Text translated into the target language. + provenance: + The history of this annotation. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Translation) + }, + ), + "TextAnchor": _reflection.GeneratedProtocolMessageType( + "TextAnchor", + (_message.Message,), + { + "TextSegment": _reflection.GeneratedProtocolMessageType( + "TextSegment", + (_message.Message,), + { + "DESCRIPTOR": _DOCUMENT_TEXTANCHOR_TEXTSEGMENT, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """A text segment in the + [Document.text][google.cloud.documentai.v1beta3.Document.text]. The + indices may be out of bounds which indicate that the text extends into + another document shard for large sharded documents. See [ShardInfo.tex + t_offset][google.cloud.documentai.v1beta3.Document.ShardInfo.text_offs + et] + + Attributes: + start_index: + [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnc + hor.TextSegment] start UTF-8 char index in the [Document.text] + [google.cloud.documentai.v1beta3.Document.text]. + end_index: + [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnc + hor.TextSegment] half open end UTF-8 char index in the [Docume + nt.text][google.cloud.documentai.v1beta3.Document.text]. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment) + }, + ), + "DESCRIPTOR": _DOCUMENT_TEXTANCHOR, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """Text reference indexing into the + [Document.text][google.cloud.documentai.v1beta3.Document.text]. + + Attributes: + text_segments: + The text segments from the [Document.text][google.cloud.docume + ntai.v1beta3.Document.text]. + content: + Contains the content of the text span so that users do not + have to look it up in the text_segments. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.TextAnchor) + }, + ), + "PageAnchor": _reflection.GeneratedProtocolMessageType( + "PageAnchor", + (_message.Message,), + { + "PageRef": _reflection.GeneratedProtocolMessageType( + "PageRef", + (_message.Message,), + { + "DESCRIPTOR": _DOCUMENT_PAGEANCHOR_PAGEREF, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """Represents a weak reference to a page element within a document. + + Attributes: + page: + Required. Index into the [Document.pages][google.cloud.documen + tai.v1beta3.Document.pages] element + layout_type: + Optional. The type of the layout element that is being + referenced if any. + layout_id: + Optional. Deprecated. Use [PageRef.bounding_poly][google.cloud + .documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly] + instead. + bounding_poly: + Optional. Identifies the bounding polygon of a layout element + on the page. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef) + }, + ), + "DESCRIPTOR": _DOCUMENT_PAGEANCHOR, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """Referencing the visual context of the entity in the + [Document.pages][google.cloud.documentai.v1beta3.Document.pages]. Page + anchors can be cross-page, consist of multiple bounding polygons and + optionally reference specific layout element types. + + Attributes: + page_refs: + One or more references to visual page elements + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.PageAnchor) + }, + ), + "Provenance": _reflection.GeneratedProtocolMessageType( + "Provenance", + (_message.Message,), + { + "Parent": _reflection.GeneratedProtocolMessageType( + "Parent", + (_message.Message,), + { + "DESCRIPTOR": _DOCUMENT_PROVENANCE_PARENT, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """Structure for referencing parent provenances. When an element replaces + one of more other elements parent references identify the elements + that are replaced. + + Attributes: + revision: + The index of the [Document.revisions] identifying the parent + revision. + id: + The id of the parent provenance. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Provenance.Parent) + }, + ), + "DESCRIPTOR": _DOCUMENT_PROVENANCE, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """Structure to identify provenance relationships between annotations in + different revisions. + + Attributes: + revision: + The index of the revision that produced this element. + id: + The Id of this operation. Needs to be unique within the scope + of the revision. + parents: + References to the original elements that are replaced. + type: + The type of provenance operation. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Provenance) + }, + ), + "Revision": _reflection.GeneratedProtocolMessageType( + "Revision", + (_message.Message,), + { + "HumanReview": _reflection.GeneratedProtocolMessageType( + "HumanReview", + (_message.Message,), + { + "DESCRIPTOR": _DOCUMENT_REVISION_HUMANREVIEW, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """Human Review information of the document. + + Attributes: + state: + Human review state. e.g. ``requested``, ``succeeded``, + ``rejected``. + state_message: + A message providing more details about the current state of + processing. For example, the rejection reason when the state + is ``rejected``. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Revision.HumanReview) + }, + ), + "DESCRIPTOR": _DOCUMENT_REVISION, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """Contains past or forward revisions of this document. + + Attributes: + source: + Who/what made the change + agent: + If the change was made by a person specify the name or id of + that person. + processor: + If the annotation was made by processor identify the processor + by its resource name. + id: + Id of the revision. Unique within the context of the document. + parent: + The revisions that this revision is based on. This can include + one or more parent (when documents are merged.) This field + represents the index into the ``revisions`` field. + create_time: + The time that the revision was created. + human_review: + Human Review information of this revision. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Revision) + }, + ), + "TextChange": _reflection.GeneratedProtocolMessageType( + "TextChange", + (_message.Message,), + { + "DESCRIPTOR": _DOCUMENT_TEXTCHANGE, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """This message is used for text changes aka. OCR corrections. + + Attributes: + text_anchor: + Provenance of the correction. Text anchor indexing into the [D + ocument.text][google.cloud.documentai.v1beta3.Document.text]. + There can only be a single ``TextAnchor.text_segments`` + element. If the start and end index of the text segment are + the same, the text change is inserted before that index. + changed_text: + The text that replaces the text identified in the + ``text_anchor``. + provenance: + The history of this annotation. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.TextChange) + }, + ), + "DESCRIPTOR": _DOCUMENT, + "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", + "__doc__": """Document represents the canonical document resource in Document + Understanding AI. It is an interchange format that provides insights + into documents and allows for collaboration between users and Document + Understanding AI to iterate and optimize for quality. + + Attributes: + source: + Original source document from the user. + uri: + Currently supports Google Cloud Storage URI of the form + ``gs://bucket_name/object_name``. Object versioning is not + supported. See `Google Cloud Storage Request URIs + `__ for + more info. + content: + Inline document content, represented as a stream of bytes. + Note: As with all ``bytes`` fields, protobuffers use a pure + binary representation, whereas JSON representations use + base64. + mime_type: + An IANA published MIME type (also referred to as media type). + For more information, see + https://www.iana.org/assignments/media-types/media- + types.xhtml. + text: + UTF-8 encoded text in reading order from the document. + text_styles: + Styles for the [Document.text][google.cloud.documentai.v1beta3 + .Document.text]. + pages: + Visual page layout for the + [Document][google.cloud.documentai.v1beta3.Document]. + entities: + A list of entities detected on [Document.text][google.cloud.do + cumentai.v1beta3.Document.text]. For document shards, entities + in this list may cross shard boundaries. + entity_relations: + Relationship among [Document.entities][google.cloud.documentai + .v1beta3.Document.entities]. + translations: + A list of translations on [Document.text][google.cloud.documen + tai.v1beta3.Document.text]. For document shards, translations + in this list may cross shard boundaries. + text_changes: + A list of text corrections made to [Document.text]. This is + usually used for annotating corrections to OCR mistakes. Text + changes for a given revision may not overlap with each other. + shard_info: + Information about the sharding if this document is sharded + part of a larger document. If the document is not sharded, + this message is not specified. + error: + Any error that occurred while processing this document. + revisions: + Revision history of this document. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document) + }, +) +_sym_db.RegisterMessage(Document) +_sym_db.RegisterMessage(Document.ShardInfo) +_sym_db.RegisterMessage(Document.Style) +_sym_db.RegisterMessage(Document.Style.FontSize) +_sym_db.RegisterMessage(Document.Page) +_sym_db.RegisterMessage(Document.Page.Dimension) +_sym_db.RegisterMessage(Document.Page.Image) +_sym_db.RegisterMessage(Document.Page.Matrix) +_sym_db.RegisterMessage(Document.Page.Layout) +_sym_db.RegisterMessage(Document.Page.Block) +_sym_db.RegisterMessage(Document.Page.Paragraph) +_sym_db.RegisterMessage(Document.Page.Line) +_sym_db.RegisterMessage(Document.Page.Token) +_sym_db.RegisterMessage(Document.Page.Token.DetectedBreak) +_sym_db.RegisterMessage(Document.Page.VisualElement) +_sym_db.RegisterMessage(Document.Page.Table) +_sym_db.RegisterMessage(Document.Page.Table.TableRow) +_sym_db.RegisterMessage(Document.Page.Table.TableCell) +_sym_db.RegisterMessage(Document.Page.FormField) +_sym_db.RegisterMessage(Document.Page.DetectedLanguage) +_sym_db.RegisterMessage(Document.Entity) +_sym_db.RegisterMessage(Document.Entity.NormalizedValue) +_sym_db.RegisterMessage(Document.EntityRelation) +_sym_db.RegisterMessage(Document.Translation) +_sym_db.RegisterMessage(Document.TextAnchor) +_sym_db.RegisterMessage(Document.TextAnchor.TextSegment) +_sym_db.RegisterMessage(Document.PageAnchor) +_sym_db.RegisterMessage(Document.PageAnchor.PageRef) +_sym_db.RegisterMessage(Document.Provenance) +_sym_db.RegisterMessage(Document.Provenance.Parent) +_sym_db.RegisterMessage(Document.Revision) +_sym_db.RegisterMessage(Document.Revision.HumanReview) +_sym_db.RegisterMessage(Document.TextChange) + + +DESCRIPTOR._options = None +_DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name["text"]._options = None +_DOCUMENT_ENTITY.fields_by_name["confidence"]._options = None +_DOCUMENT_ENTITY.fields_by_name["page_anchor"]._options = None +_DOCUMENT_ENTITY.fields_by_name["normalized_value"]._options = None +_DOCUMENT_ENTITY.fields_by_name["properties"]._options = None +_DOCUMENT_ENTITY.fields_by_name["provenance"]._options = None +_DOCUMENT_ENTITY.fields_by_name["redacted"]._options = None +_DOCUMENT_PAGEANCHOR_PAGEREF.fields_by_name["page"]._options = None +_DOCUMENT_PAGEANCHOR_PAGEREF.fields_by_name["layout_type"]._options = None +_DOCUMENT_PAGEANCHOR_PAGEREF.fields_by_name["layout_id"]._options = None +_DOCUMENT_PAGEANCHOR_PAGEREF.fields_by_name["bounding_poly"]._options = None +# @@protoc_insertion_point(module_scope) diff --git a/google/cloud/documentai_v1beta3/proto/document_pb2_grpc.py b/google/cloud/documentai_v1beta3/proto/document_pb2_grpc.py new file mode 100644 index 00000000..8a939394 --- /dev/null +++ b/google/cloud/documentai_v1beta3/proto/document_pb2_grpc.py @@ -0,0 +1,3 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc diff --git a/google/cloud/documentai_v1beta3/proto/document_processor_service_pb2.py b/google/cloud/documentai_v1beta3/proto/document_processor_service_pb2.py new file mode 100644 index 00000000..1ca7f93c --- /dev/null +++ b/google/cloud/documentai_v1beta3/proto/document_processor_service_pb2.py @@ -0,0 +1,1290 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai_v1beta3/proto/document_processor_service.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import client_pb2 as google_dot_api_dot_client__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 +from google.cloud.documentai_v1beta3.proto import ( + document_pb2 as google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__pb2, +) +from google.longrunning import ( + operations_pb2 as google_dot_longrunning_dot_operations__pb2, +) +from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name="google/cloud/documentai_v1beta3/proto/document_processor_service.proto", + package="google.cloud.documentai.v1beta3", + syntax="proto3", + serialized_options=b"\n#com.google.cloud.documentai.v1beta3B\032DocumentAiProcessorServiceP\001ZIgoogle.golang.org/genproto/googleapis/cloud/documentai/v1beta3;documentai\252\002\037Google.Cloud.DocumentAI.v1beta3\312\002\037Google\\Cloud\\DocumentAi\\v1beta3\352\002!Google::Cloud::DocumentAI::master\352AM\n\"documentai.googleapis.com/Location\022'projects/{project}/locations/{location}\352Ae\n#documentai.googleapis.com/Processor\022>projects/{project}/locations/{location}/processors/{processor}\352A\177\n+documentai.googleapis.com/HumanReviewConfig\022Pprojects/{project}/locations/{location}/processors/{processor}/humanReviewConfig", + create_key=_descriptor._internal_create_key, + serialized_pb=b'\nFgoogle/cloud/documentai_v1beta3/proto/document_processor_service.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x34google/cloud/documentai_v1beta3/proto/document.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto"\xa3\x01\n\x0eProcessRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\x12;\n\x08\x64ocument\x18\x02 \x01(\x0b\x32).google.cloud.documentai.v1beta3.Document\x12\x19\n\x11skip_human_review\x18\x03 \x01(\x08"n\n\x0fProcessResponse\x12;\n\x08\x64ocument\x18\x01 \x01(\x0b\x32).google.cloud.documentai.v1beta3.Document\x12\x1e\n\x16human_review_operation\x18\x02 \x01(\t"\xf6\x02\n\x13\x42\x61tchProcessRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\x12\\\n\rinput_configs\x18\x02 \x03(\x0b\x32\x45.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig\x12]\n\routput_config\x18\x03 \x01(\x0b\x32\x46.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig\x1a\x39\n\x10\x42\x61tchInputConfig\x12\x12\n\ngcs_source\x18\x01 \x01(\t\x12\x11\n\tmime_type\x18\x02 \x01(\t\x1a,\n\x11\x42\x61tchOutputConfig\x12\x17\n\x0fgcs_destination\x18\x01 \x01(\t"\x16\n\x14\x42\x61tchProcessResponse"\xdd\x04\n\x14\x42\x61tchProcessMetadata\x12J\n\x05state\x18\x01 \x01(\x0e\x32;.google.cloud.documentai.v1beta3.BatchProcessMetadata.State\x12\x15\n\rstate_message\x18\x02 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12r\n\x1bindividual_process_statuses\x18\x05 \x03(\x0b\x32M.google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus\x1a\x97\x01\n\x17IndividualProcessStatus\x12\x18\n\x10input_gcs_source\x18\x01 \x01(\t\x12"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x1e\n\x16output_gcs_destination\x18\x03 \x01(\t\x12\x1e\n\x16human_review_operation\x18\x04 \x01(\t"r\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07WAITING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06"\xa6\x01\n\x15ReviewDocumentRequest\x12P\n\x13human_review_config\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+documentai.googleapis.com/HumanReviewConfig\x12;\n\x08\x64ocument\x18\x02 \x01(\x0b\x32).google.cloud.documentai.v1beta3.Document"1\n\x16ReviewDocumentResponse\x12\x17\n\x0fgcs_destination\x18\x01 \x01(\t"\xd8\x02\n\x1fReviewDocumentOperationMetadata\x12U\n\x05state\x18\x01 \x01(\x0e\x32\x46.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State\x12\x15\n\rstate_message\x18\x02 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\x0e\n\nCANCELLING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\r\n\tCANCELLED\x10\x05\x32\xd2\x06\n\x18\x44ocumentProcessorService\x12\xc3\x01\n\x0fProcessDocument\x12/.google.cloud.documentai.v1beta3.ProcessRequest\x1a\x30.google.cloud.documentai.v1beta3.ProcessResponse"M\x82\xd3\xe4\x93\x02@";/v1beta3/{name=projects/*/locations/*/processors/*}:process:\x01*\xda\x41\x04name\x12\xf0\x01\n\x15\x42\x61tchProcessDocuments\x12\x34.google.cloud.documentai.v1beta3.BatchProcessRequest\x1a\x1d.google.longrunning.Operation"\x81\x01\x82\xd3\xe4\x93\x02\x45"@/v1beta3/{name=projects/*/locations/*/processors/*}:batchProcess:\x01*\xda\x41\x04name\xca\x41,\n\x14\x42\x61tchProcessResponse\x12\x14\x42\x61tchProcessMetadata\x12\xaa\x02\n\x0eReviewDocument\x12\x36.google.cloud.documentai.v1beta3.ReviewDocumentRequest\x1a\x1d.google.longrunning.Operation"\xc0\x01\x82\xd3\xe4\x93\x02h"c/v1beta3/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument:\x01*\xda\x41\x13human_review_config\xca\x41\x39\n\x16ReviewDocumentResponse\x12\x1fReviewDocumentOperationMetadata\x1aP\xca\x41\x1cus-documentai.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xb0\x04\n#com.google.cloud.documentai.v1beta3B\x1a\x44ocumentAiProcessorServiceP\x01ZIgoogle.golang.org/genproto/googleapis/cloud/documentai/v1beta3;documentai\xaa\x02\x1fGoogle.Cloud.DocumentAI.v1beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAi\\v1beta3\xea\x02!Google::Cloud::DocumentAI::master\xea\x41M\n"documentai.googleapis.com/Location\x12\'projects/{project}/locations/{location}\xea\x41\x65\n#documentai.googleapis.com/Processor\x12>projects/{project}/locations/{location}/processors/{processor}\xea\x41\x7f\n+documentai.googleapis.com/HumanReviewConfig\x12Pprojects/{project}/locations/{location}/processors/{processor}/humanReviewConfigb\x06proto3', + dependencies=[ + google_dot_api_dot_annotations__pb2.DESCRIPTOR, + google_dot_api_dot_client__pb2.DESCRIPTOR, + google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, + google_dot_api_dot_resource__pb2.DESCRIPTOR, + google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__pb2.DESCRIPTOR, + google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, + google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, + google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, + google_dot_rpc_dot_status__pb2.DESCRIPTOR, + ], +) + + +_BATCHPROCESSMETADATA_STATE = _descriptor.EnumDescriptor( + name="State", + full_name="google.cloud.documentai.v1beta3.BatchProcessMetadata.State", + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name="STATE_UNSPECIFIED", + index=0, + number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="WAITING", + index=1, + number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="RUNNING", + index=2, + number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="SUCCEEDED", + index=3, + number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="CANCELLING", + index=4, + number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="CANCELLED", + index=5, + number=5, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="FAILED", + index=6, + number=6, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + ], + containing_type=None, + serialized_options=None, + serialized_start=1576, + serialized_end=1690, +) +_sym_db.RegisterEnumDescriptor(_BATCHPROCESSMETADATA_STATE) + +_REVIEWDOCUMENTOPERATIONMETADATA_STATE = _descriptor.EnumDescriptor( + name="State", + full_name="google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State", + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name="STATE_UNSPECIFIED", + index=0, + number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="RUNNING", + index=1, + number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="CANCELLING", + index=2, + number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="SUCCEEDED", + index=3, + number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="FAILED", + index=4, + number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.EnumValueDescriptor( + name="CANCELLED", + index=5, + number=5, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), + ], + containing_type=None, + serialized_options=None, + serialized_start=2156, + serialized_end=2257, +) +_sym_db.RegisterEnumDescriptor(_REVIEWDOCUMENTOPERATIONMETADATA_STATE) + + +_PROCESSREQUEST = _descriptor.Descriptor( + name="ProcessRequest", + full_name="google.cloud.documentai.v1beta3.ProcessRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.documentai.v1beta3.ProcessRequest.name", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\340A\002\372A%\n#documentai.googleapis.com/Processor", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="document", + full_name="google.cloud.documentai.v1beta3.ProcessRequest.document", + index=1, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="skip_human_review", + full_name="google.cloud.documentai.v1beta3.ProcessRequest.skip_human_review", + index=2, + number=3, + type=8, + cpp_type=7, + label=1, + has_default_value=False, + default_value=False, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=406, + serialized_end=569, +) + + +_PROCESSRESPONSE = _descriptor.Descriptor( + name="ProcessResponse", + full_name="google.cloud.documentai.v1beta3.ProcessResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="document", + full_name="google.cloud.documentai.v1beta3.ProcessResponse.document", + index=0, + number=1, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="human_review_operation", + full_name="google.cloud.documentai.v1beta3.ProcessResponse.human_review_operation", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=571, + serialized_end=681, +) + + +_BATCHPROCESSREQUEST_BATCHINPUTCONFIG = _descriptor.Descriptor( + name="BatchInputConfig", + full_name="google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="gcs_source", + full_name="google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig.gcs_source", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="mime_type", + full_name="google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig.mime_type", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=955, + serialized_end=1012, +) + +_BATCHPROCESSREQUEST_BATCHOUTPUTCONFIG = _descriptor.Descriptor( + name="BatchOutputConfig", + full_name="google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="gcs_destination", + full_name="google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig.gcs_destination", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1014, + serialized_end=1058, +) + +_BATCHPROCESSREQUEST = _descriptor.Descriptor( + name="BatchProcessRequest", + full_name="google.cloud.documentai.v1beta3.BatchProcessRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.documentai.v1beta3.BatchProcessRequest.name", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\340A\002\372A%\n#documentai.googleapis.com/Processor", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="input_configs", + full_name="google.cloud.documentai.v1beta3.BatchProcessRequest.input_configs", + index=1, + number=2, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="output_config", + full_name="google.cloud.documentai.v1beta3.BatchProcessRequest.output_config", + index=2, + number=3, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[ + _BATCHPROCESSREQUEST_BATCHINPUTCONFIG, + _BATCHPROCESSREQUEST_BATCHOUTPUTCONFIG, + ], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=684, + serialized_end=1058, +) + + +_BATCHPROCESSRESPONSE = _descriptor.Descriptor( + name="BatchProcessResponse", + full_name="google.cloud.documentai.v1beta3.BatchProcessResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1060, + serialized_end=1082, +) + + +_BATCHPROCESSMETADATA_INDIVIDUALPROCESSSTATUS = _descriptor.Descriptor( + name="IndividualProcessStatus", + full_name="google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="input_gcs_source", + full_name="google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="status", + full_name="google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.status", + index=1, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="output_gcs_destination", + full_name="google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.output_gcs_destination", + index=2, + number=3, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="human_review_operation", + full_name="google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.human_review_operation", + index=3, + number=4, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1423, + serialized_end=1574, +) + +_BATCHPROCESSMETADATA = _descriptor.Descriptor( + name="BatchProcessMetadata", + full_name="google.cloud.documentai.v1beta3.BatchProcessMetadata", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="state", + full_name="google.cloud.documentai.v1beta3.BatchProcessMetadata.state", + index=0, + number=1, + type=14, + cpp_type=8, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="state_message", + full_name="google.cloud.documentai.v1beta3.BatchProcessMetadata.state_message", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="create_time", + full_name="google.cloud.documentai.v1beta3.BatchProcessMetadata.create_time", + index=2, + number=3, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="update_time", + full_name="google.cloud.documentai.v1beta3.BatchProcessMetadata.update_time", + index=3, + number=4, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="individual_process_statuses", + full_name="google.cloud.documentai.v1beta3.BatchProcessMetadata.individual_process_statuses", + index=4, + number=5, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[_BATCHPROCESSMETADATA_INDIVIDUALPROCESSSTATUS,], + enum_types=[_BATCHPROCESSMETADATA_STATE,], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1085, + serialized_end=1690, +) + + +_REVIEWDOCUMENTREQUEST = _descriptor.Descriptor( + name="ReviewDocumentRequest", + full_name="google.cloud.documentai.v1beta3.ReviewDocumentRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="human_review_config", + full_name="google.cloud.documentai.v1beta3.ReviewDocumentRequest.human_review_config", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\340A\002\372A-\n+documentai.googleapis.com/HumanReviewConfig", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="document", + full_name="google.cloud.documentai.v1beta3.ReviewDocumentRequest.document", + index=1, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1693, + serialized_end=1859, +) + + +_REVIEWDOCUMENTRESPONSE = _descriptor.Descriptor( + name="ReviewDocumentResponse", + full_name="google.cloud.documentai.v1beta3.ReviewDocumentResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="gcs_destination", + full_name="google.cloud.documentai.v1beta3.ReviewDocumentResponse.gcs_destination", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1861, + serialized_end=1910, +) + + +_REVIEWDOCUMENTOPERATIONMETADATA = _descriptor.Descriptor( + name="ReviewDocumentOperationMetadata", + full_name="google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="state", + full_name="google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.state", + index=0, + number=1, + type=14, + cpp_type=8, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="state_message", + full_name="google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.state_message", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="create_time", + full_name="google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.create_time", + index=2, + number=3, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="update_time", + full_name="google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.update_time", + index=3, + number=4, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[_REVIEWDOCUMENTOPERATIONMETADATA_STATE,], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1913, + serialized_end=2257, +) + +_PROCESSREQUEST.fields_by_name[ + "document" +].message_type = ( + google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__pb2._DOCUMENT +) +_PROCESSRESPONSE.fields_by_name[ + "document" +].message_type = ( + google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__pb2._DOCUMENT +) +_BATCHPROCESSREQUEST_BATCHINPUTCONFIG.containing_type = _BATCHPROCESSREQUEST +_BATCHPROCESSREQUEST_BATCHOUTPUTCONFIG.containing_type = _BATCHPROCESSREQUEST +_BATCHPROCESSREQUEST.fields_by_name[ + "input_configs" +].message_type = _BATCHPROCESSREQUEST_BATCHINPUTCONFIG +_BATCHPROCESSREQUEST.fields_by_name[ + "output_config" +].message_type = _BATCHPROCESSREQUEST_BATCHOUTPUTCONFIG +_BATCHPROCESSMETADATA_INDIVIDUALPROCESSSTATUS.fields_by_name[ + "status" +].message_type = google_dot_rpc_dot_status__pb2._STATUS +_BATCHPROCESSMETADATA_INDIVIDUALPROCESSSTATUS.containing_type = _BATCHPROCESSMETADATA +_BATCHPROCESSMETADATA.fields_by_name["state"].enum_type = _BATCHPROCESSMETADATA_STATE +_BATCHPROCESSMETADATA.fields_by_name[ + "create_time" +].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP +_BATCHPROCESSMETADATA.fields_by_name[ + "update_time" +].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP +_BATCHPROCESSMETADATA.fields_by_name[ + "individual_process_statuses" +].message_type = _BATCHPROCESSMETADATA_INDIVIDUALPROCESSSTATUS +_BATCHPROCESSMETADATA_STATE.containing_type = _BATCHPROCESSMETADATA +_REVIEWDOCUMENTREQUEST.fields_by_name[ + "document" +].message_type = ( + google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__pb2._DOCUMENT +) +_REVIEWDOCUMENTOPERATIONMETADATA.fields_by_name[ + "state" +].enum_type = _REVIEWDOCUMENTOPERATIONMETADATA_STATE +_REVIEWDOCUMENTOPERATIONMETADATA.fields_by_name[ + "create_time" +].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP +_REVIEWDOCUMENTOPERATIONMETADATA.fields_by_name[ + "update_time" +].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP +_REVIEWDOCUMENTOPERATIONMETADATA_STATE.containing_type = ( + _REVIEWDOCUMENTOPERATIONMETADATA +) +DESCRIPTOR.message_types_by_name["ProcessRequest"] = _PROCESSREQUEST +DESCRIPTOR.message_types_by_name["ProcessResponse"] = _PROCESSRESPONSE +DESCRIPTOR.message_types_by_name["BatchProcessRequest"] = _BATCHPROCESSREQUEST +DESCRIPTOR.message_types_by_name["BatchProcessResponse"] = _BATCHPROCESSRESPONSE +DESCRIPTOR.message_types_by_name["BatchProcessMetadata"] = _BATCHPROCESSMETADATA +DESCRIPTOR.message_types_by_name["ReviewDocumentRequest"] = _REVIEWDOCUMENTREQUEST +DESCRIPTOR.message_types_by_name["ReviewDocumentResponse"] = _REVIEWDOCUMENTRESPONSE +DESCRIPTOR.message_types_by_name[ + "ReviewDocumentOperationMetadata" +] = _REVIEWDOCUMENTOPERATIONMETADATA +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +ProcessRequest = _reflection.GeneratedProtocolMessageType( + "ProcessRequest", + (_message.Message,), + { + "DESCRIPTOR": _PROCESSREQUEST, + "__module__": "google.cloud.documentai_v1beta3.proto.document_processor_service_pb2", + "__doc__": """Request message for the process document method. + + Attributes: + name: + Required. The processor resource name. + document: + The document payload, the [content] and [mime_type] fields + must be set. + skip_human_review: + Whether Human Review feature should be skipped for this + request. Default to false. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.ProcessRequest) + }, +) +_sym_db.RegisterMessage(ProcessRequest) + +ProcessResponse = _reflection.GeneratedProtocolMessageType( + "ProcessResponse", + (_message.Message,), + { + "DESCRIPTOR": _PROCESSRESPONSE, + "__module__": "google.cloud.documentai_v1beta3.proto.document_processor_service_pb2", + "__doc__": """Response message for the process document method. + + Attributes: + document: + The document payload, will populate fields based on the + processor’s behavior. + human_review_operation: + The name of the operation triggered by the processed document. + If the human review process is not triggered, this field will + be empty. It has the same response type and metadata as the + long running operation returned by ReviewDocument method. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.ProcessResponse) + }, +) +_sym_db.RegisterMessage(ProcessResponse) + +BatchProcessRequest = _reflection.GeneratedProtocolMessageType( + "BatchProcessRequest", + (_message.Message,), + { + "BatchInputConfig": _reflection.GeneratedProtocolMessageType( + "BatchInputConfig", + (_message.Message,), + { + "DESCRIPTOR": _BATCHPROCESSREQUEST_BATCHINPUTCONFIG, + "__module__": "google.cloud.documentai_v1beta3.proto.document_processor_service_pb2", + "__doc__": """The message for input config in batch process. + + Attributes: + gcs_source: + The Cloud Storage location as the source of the document. + mime_type: + Mimetype of the input. If the input is a raw document, the + supported mimetypes are application/pdf, image/tiff, and + image/gif. If the input is a [Document] proto, the type should + be application/json. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig) + }, + ), + "BatchOutputConfig": _reflection.GeneratedProtocolMessageType( + "BatchOutputConfig", + (_message.Message,), + { + "DESCRIPTOR": _BATCHPROCESSREQUEST_BATCHOUTPUTCONFIG, + "__module__": "google.cloud.documentai_v1beta3.proto.document_processor_service_pb2", + "__doc__": """The message for output config in batch process. + + Attributes: + gcs_destination: + The output Cloud Storage directory to put the processed + documents. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig) + }, + ), + "DESCRIPTOR": _BATCHPROCESSREQUEST, + "__module__": "google.cloud.documentai_v1beta3.proto.document_processor_service_pb2", + "__doc__": """Request message for batch process document method. + + Attributes: + name: + Required. The processor resource name. + input_configs: + The input config for each single document in the batch + process. + output_config: + The overall output config for batch process. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.BatchProcessRequest) + }, +) +_sym_db.RegisterMessage(BatchProcessRequest) +_sym_db.RegisterMessage(BatchProcessRequest.BatchInputConfig) +_sym_db.RegisterMessage(BatchProcessRequest.BatchOutputConfig) + +BatchProcessResponse = _reflection.GeneratedProtocolMessageType( + "BatchProcessResponse", + (_message.Message,), + { + "DESCRIPTOR": _BATCHPROCESSRESPONSE, + "__module__": "google.cloud.documentai_v1beta3.proto.document_processor_service_pb2", + "__doc__": """Response message for batch process document method.""", + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.BatchProcessResponse) + }, +) +_sym_db.RegisterMessage(BatchProcessResponse) + +BatchProcessMetadata = _reflection.GeneratedProtocolMessageType( + "BatchProcessMetadata", + (_message.Message,), + { + "IndividualProcessStatus": _reflection.GeneratedProtocolMessageType( + "IndividualProcessStatus", + (_message.Message,), + { + "DESCRIPTOR": _BATCHPROCESSMETADATA_INDIVIDUALPROCESSSTATUS, + "__module__": "google.cloud.documentai_v1beta3.proto.document_processor_service_pb2", + "__doc__": """The status of a each individual document in the batch process. + + Attributes: + input_gcs_source: + The source of the document, same as the [input_gcs_source] + field in the request when the batch process started. The batch + process is started by take snapshot of that document, since a + user can move or change that document during the process. + status: + The status of the processing of the document. + output_gcs_destination: + The output_gcs_destination (in the request as + ‘output_gcs_destination’) of the processed document if it was + successful, otherwise empty. + human_review_operation: + The name of the operation triggered by the processed document. + If the human review process is not triggered, this field will + be empty. It has the same response type and metadata as the + long running operation returned by ReviewDocument method. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus) + }, + ), + "DESCRIPTOR": _BATCHPROCESSMETADATA, + "__module__": "google.cloud.documentai_v1beta3.proto.document_processor_service_pb2", + "__doc__": """The long running operation metadata for batch process method. + + Attributes: + state: + The state of the current batch processing. + state_message: + A message providing more details about the current state of + processing. For example, the error message if the operation is + failed. + create_time: + The creation time of the operation. + update_time: + The last update time of the operation. + individual_process_statuses: + The list of response details of each document. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.BatchProcessMetadata) + }, +) +_sym_db.RegisterMessage(BatchProcessMetadata) +_sym_db.RegisterMessage(BatchProcessMetadata.IndividualProcessStatus) + +ReviewDocumentRequest = _reflection.GeneratedProtocolMessageType( + "ReviewDocumentRequest", + (_message.Message,), + { + "DESCRIPTOR": _REVIEWDOCUMENTREQUEST, + "__module__": "google.cloud.documentai_v1beta3.proto.document_processor_service_pb2", + "__doc__": """Request message for review document method. + + Attributes: + human_review_config: + Required. The resource name of the HumanReviewConfig that the + document will be reviewed with. + document: + The document that needs human review. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.ReviewDocumentRequest) + }, +) +_sym_db.RegisterMessage(ReviewDocumentRequest) + +ReviewDocumentResponse = _reflection.GeneratedProtocolMessageType( + "ReviewDocumentResponse", + (_message.Message,), + { + "DESCRIPTOR": _REVIEWDOCUMENTRESPONSE, + "__module__": "google.cloud.documentai_v1beta3.proto.document_processor_service_pb2", + "__doc__": """Response message for review document method. + + Attributes: + gcs_destination: + The Cloud Storage uri for the human reviewed document. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.ReviewDocumentResponse) + }, +) +_sym_db.RegisterMessage(ReviewDocumentResponse) + +ReviewDocumentOperationMetadata = _reflection.GeneratedProtocolMessageType( + "ReviewDocumentOperationMetadata", + (_message.Message,), + { + "DESCRIPTOR": _REVIEWDOCUMENTOPERATIONMETADATA, + "__module__": "google.cloud.documentai_v1beta3.proto.document_processor_service_pb2", + "__doc__": """The long running operation metadata for review document method. + + Attributes: + state: + Used only when Operation.done is false. + state_message: + A message providing more details about the current state of + processing. For example, the error message if the operation is + failed. + create_time: + The creation time of the operation. + update_time: + The last update time of the operation. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata) + }, +) +_sym_db.RegisterMessage(ReviewDocumentOperationMetadata) + + +DESCRIPTOR._options = None +_PROCESSREQUEST.fields_by_name["name"]._options = None +_BATCHPROCESSREQUEST.fields_by_name["name"]._options = None +_REVIEWDOCUMENTREQUEST.fields_by_name["human_review_config"]._options = None + +_DOCUMENTPROCESSORSERVICE = _descriptor.ServiceDescriptor( + name="DocumentProcessorService", + full_name="google.cloud.documentai.v1beta3.DocumentProcessorService", + file=DESCRIPTOR, + index=0, + serialized_options=b"\312A\034us-documentai.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform", + create_key=_descriptor._internal_create_key, + serialized_start=2260, + serialized_end=3110, + methods=[ + _descriptor.MethodDescriptor( + name="ProcessDocument", + full_name="google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument", + index=0, + containing_service=None, + input_type=_PROCESSREQUEST, + output_type=_PROCESSRESPONSE, + serialized_options=b'\202\323\344\223\002@";/v1beta3/{name=projects/*/locations/*/processors/*}:process:\001*\332A\004name', + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name="BatchProcessDocuments", + full_name="google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments", + index=1, + containing_service=None, + input_type=_BATCHPROCESSREQUEST, + output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, + serialized_options=b'\202\323\344\223\002E"@/v1beta3/{name=projects/*/locations/*/processors/*}:batchProcess:\001*\332A\004name\312A,\n\024BatchProcessResponse\022\024BatchProcessMetadata', + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name="ReviewDocument", + full_name="google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument", + index=2, + containing_service=None, + input_type=_REVIEWDOCUMENTREQUEST, + output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, + serialized_options=b'\202\323\344\223\002h"c/v1beta3/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument:\001*\332A\023human_review_config\312A9\n\026ReviewDocumentResponse\022\037ReviewDocumentOperationMetadata', + create_key=_descriptor._internal_create_key, + ), + ], +) +_sym_db.RegisterServiceDescriptor(_DOCUMENTPROCESSORSERVICE) + +DESCRIPTOR.services_by_name["DocumentProcessorService"] = _DOCUMENTPROCESSORSERVICE + +# @@protoc_insertion_point(module_scope) diff --git a/google/cloud/documentai_v1beta3/proto/document_processor_service_pb2_grpc.py b/google/cloud/documentai_v1beta3/proto/document_processor_service_pb2_grpc.py new file mode 100644 index 00000000..c0bdf3a2 --- /dev/null +++ b/google/cloud/documentai_v1beta3/proto/document_processor_service_pb2_grpc.py @@ -0,0 +1,185 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + +from google.cloud.documentai_v1beta3.proto import ( + document_processor_service_pb2 as google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2, +) +from google.longrunning import ( + operations_pb2 as google_dot_longrunning_dot_operations__pb2, +) + + +class DocumentProcessorServiceStub(object): + """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. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ProcessDocument = channel.unary_unary( + "/google.cloud.documentai.v1beta3.DocumentProcessorService/ProcessDocument", + request_serializer=google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2.ProcessRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2.ProcessResponse.FromString, + ) + self.BatchProcessDocuments = channel.unary_unary( + "/google.cloud.documentai.v1beta3.DocumentProcessorService/BatchProcessDocuments", + request_serializer=google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2.BatchProcessRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + self.ReviewDocument = channel.unary_unary( + "/google.cloud.documentai.v1beta3.DocumentProcessorService/ReviewDocument", + request_serializer=google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2.ReviewDocumentRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + + +class DocumentProcessorServiceServicer(object): + """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. + """ + + def ProcessDocument(self, request, context): + """Processes a single document. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def BatchProcessDocuments(self, request, context): + """LRO endpoint to batch process many documents. The output is written + to Cloud Storage as JSON in the [Document] format. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def ReviewDocument(self, request, context): + """Send a document for Human Review. The input document should be processed by + the specified processor. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + +def add_DocumentProcessorServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + "ProcessDocument": grpc.unary_unary_rpc_method_handler( + servicer.ProcessDocument, + request_deserializer=google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2.ProcessRequest.FromString, + response_serializer=google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2.ProcessResponse.SerializeToString, + ), + "BatchProcessDocuments": grpc.unary_unary_rpc_method_handler( + servicer.BatchProcessDocuments, + request_deserializer=google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2.BatchProcessRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + "ReviewDocument": grpc.unary_unary_rpc_method_handler( + servicer.ReviewDocument, + request_deserializer=google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2.ReviewDocumentRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + "google.cloud.documentai.v1beta3.DocumentProcessorService", rpc_method_handlers + ) + server.add_generic_rpc_handlers((generic_handler,)) + + +# This class is part of an EXPERIMENTAL API. +class DocumentProcessorService(object): + """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. + """ + + @staticmethod + def ProcessDocument( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/google.cloud.documentai.v1beta3.DocumentProcessorService/ProcessDocument", + google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2.ProcessRequest.SerializeToString, + google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2.ProcessResponse.FromString, + options, + channel_credentials, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def BatchProcessDocuments( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/google.cloud.documentai.v1beta3.DocumentProcessorService/BatchProcessDocuments", + google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2.BatchProcessRequest.SerializeToString, + google_dot_longrunning_dot_operations__pb2.Operation.FromString, + options, + channel_credentials, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def ReviewDocument( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/google.cloud.documentai.v1beta3.DocumentProcessorService/ReviewDocument", + google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2.ReviewDocumentRequest.SerializeToString, + google_dot_longrunning_dot_operations__pb2.Operation.FromString, + options, + channel_credentials, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) diff --git a/google/cloud/documentai_v1beta3/proto/geometry_pb2.py b/google/cloud/documentai_v1beta3/proto/geometry_pb2.py new file mode 100644 index 00000000..f4f61042 --- /dev/null +++ b/google/cloud/documentai_v1beta3/proto/geometry_pb2.py @@ -0,0 +1,270 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai_v1beta3/proto/geometry.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name="google/cloud/documentai_v1beta3/proto/geometry.proto", + package="google.cloud.documentai.v1beta3", + syntax="proto3", + serialized_options=b"\n#com.google.cloud.documentai.v1beta3B\rGeometryProtoP\001ZIgoogle.golang.org/genproto/googleapis/cloud/documentai/v1beta3;documentai\252\002\037Google.Cloud.DocumentAI.v1beta3\312\002\037Google\\Cloud\\DocumentAi\\v1beta3\352\002!Google::Cloud::DocumentAI::master", + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n4google/cloud/documentai_v1beta3/proto/geometry.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a\x1cgoogle/api/annotations.proto"\x1e\n\x06Vertex\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05"(\n\x10NormalizedVertex\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02"\x99\x01\n\x0c\x42oundingPoly\x12\x39\n\x08vertices\x18\x01 \x03(\x0b\x32\'.google.cloud.documentai.v1beta3.Vertex\x12N\n\x13normalized_vertices\x18\x02 \x03(\x0b\x32\x31.google.cloud.documentai.v1beta3.NormalizedVertexB\xe9\x01\n#com.google.cloud.documentai.v1beta3B\rGeometryProtoP\x01ZIgoogle.golang.org/genproto/googleapis/cloud/documentai/v1beta3;documentai\xaa\x02\x1fGoogle.Cloud.DocumentAI.v1beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAi\\v1beta3\xea\x02!Google::Cloud::DocumentAI::masterb\x06proto3', + dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR,], +) + + +_VERTEX = _descriptor.Descriptor( + name="Vertex", + full_name="google.cloud.documentai.v1beta3.Vertex", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="x", + full_name="google.cloud.documentai.v1beta3.Vertex.x", + index=0, + number=1, + type=5, + cpp_type=1, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="y", + full_name="google.cloud.documentai.v1beta3.Vertex.y", + index=1, + number=2, + type=5, + cpp_type=1, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=119, + serialized_end=149, +) + + +_NORMALIZEDVERTEX = _descriptor.Descriptor( + name="NormalizedVertex", + full_name="google.cloud.documentai.v1beta3.NormalizedVertex", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="x", + full_name="google.cloud.documentai.v1beta3.NormalizedVertex.x", + index=0, + number=1, + type=2, + cpp_type=6, + label=1, + has_default_value=False, + default_value=float(0), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="y", + full_name="google.cloud.documentai.v1beta3.NormalizedVertex.y", + index=1, + number=2, + type=2, + cpp_type=6, + label=1, + has_default_value=False, + default_value=float(0), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=151, + serialized_end=191, +) + + +_BOUNDINGPOLY = _descriptor.Descriptor( + name="BoundingPoly", + full_name="google.cloud.documentai.v1beta3.BoundingPoly", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="vertices", + full_name="google.cloud.documentai.v1beta3.BoundingPoly.vertices", + index=0, + number=1, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="normalized_vertices", + full_name="google.cloud.documentai.v1beta3.BoundingPoly.normalized_vertices", + index=1, + number=2, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=194, + serialized_end=347, +) + +_BOUNDINGPOLY.fields_by_name["vertices"].message_type = _VERTEX +_BOUNDINGPOLY.fields_by_name["normalized_vertices"].message_type = _NORMALIZEDVERTEX +DESCRIPTOR.message_types_by_name["Vertex"] = _VERTEX +DESCRIPTOR.message_types_by_name["NormalizedVertex"] = _NORMALIZEDVERTEX +DESCRIPTOR.message_types_by_name["BoundingPoly"] = _BOUNDINGPOLY +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Vertex = _reflection.GeneratedProtocolMessageType( + "Vertex", + (_message.Message,), + { + "DESCRIPTOR": _VERTEX, + "__module__": "google.cloud.documentai_v1beta3.proto.geometry_pb2", + "__doc__": """X coordinate. + + Attributes: + y: + Y coordinate. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Vertex) + }, +) +_sym_db.RegisterMessage(Vertex) + +NormalizedVertex = _reflection.GeneratedProtocolMessageType( + "NormalizedVertex", + (_message.Message,), + { + "DESCRIPTOR": _NORMALIZEDVERTEX, + "__module__": "google.cloud.documentai_v1beta3.proto.geometry_pb2", + "__doc__": """X coordinate. + + Attributes: + y: + Y coordinate. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.NormalizedVertex) + }, +) +_sym_db.RegisterMessage(NormalizedVertex) + +BoundingPoly = _reflection.GeneratedProtocolMessageType( + "BoundingPoly", + (_message.Message,), + { + "DESCRIPTOR": _BOUNDINGPOLY, + "__module__": "google.cloud.documentai_v1beta3.proto.geometry_pb2", + "__doc__": """A bounding polygon for the detected image annotation. + + Attributes: + vertices: + The bounding polygon vertices. + normalized_vertices: + The bounding polygon normalized vertices. + """, + # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.BoundingPoly) + }, +) +_sym_db.RegisterMessage(BoundingPoly) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/google/cloud/documentai_v1beta3/proto/geometry_pb2_grpc.py b/google/cloud/documentai_v1beta3/proto/geometry_pb2_grpc.py new file mode 100644 index 00000000..8a939394 --- /dev/null +++ b/google/cloud/documentai_v1beta3/proto/geometry_pb2_grpc.py @@ -0,0 +1,3 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc diff --git a/synth.metadata b/synth.metadata index 3a7962ec..ffff661b 100644 --- a/synth.metadata +++ b/synth.metadata @@ -3,8 +3,16 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/python-documentai", - "sha": "ec70a8cec0f1fbd0f8ec18189139e632ec28b025" + "remote": "https://github.com/googleapis/python-documentai.git", + "sha": "23223987206f190d0333a0b379827fa4253d0f97" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "cb7fc620590382a4a2ea6ffdf6f51ae0e77bbbb5", + "internalRef": "334682521" } }, { @@ -41,5 +49,115 @@ "generator": "bazel" } } + ], + "generatedFiles": [ + ".flake8", + ".github/CONTRIBUTING.md", + ".github/ISSUE_TEMPLATE/bug_report.md", + ".github/ISSUE_TEMPLATE/feature_request.md", + ".github/ISSUE_TEMPLATE/support_request.md", + ".github/PULL_REQUEST_TEMPLATE.md", + ".github/release-please.yml", + ".github/snippet-bot.yml", + ".gitignore", + ".kokoro/build.sh", + ".kokoro/continuous/common.cfg", + ".kokoro/continuous/continuous.cfg", + ".kokoro/docker/docs/Dockerfile", + ".kokoro/docker/docs/fetch_gpg_keys.sh", + ".kokoro/docs/common.cfg", + ".kokoro/docs/docs-presubmit.cfg", + ".kokoro/docs/docs.cfg", + ".kokoro/populate-secrets.sh", + ".kokoro/presubmit/common.cfg", + ".kokoro/presubmit/presubmit.cfg", + ".kokoro/publish-docs.sh", + ".kokoro/release.sh", + ".kokoro/release/common.cfg", + ".kokoro/release/release.cfg", + ".kokoro/samples/lint/common.cfg", + ".kokoro/samples/lint/continuous.cfg", + ".kokoro/samples/lint/periodic.cfg", + ".kokoro/samples/lint/presubmit.cfg", + ".kokoro/samples/python3.6/common.cfg", + ".kokoro/samples/python3.6/continuous.cfg", + ".kokoro/samples/python3.6/periodic.cfg", + ".kokoro/samples/python3.6/presubmit.cfg", + ".kokoro/samples/python3.7/common.cfg", + ".kokoro/samples/python3.7/continuous.cfg", + ".kokoro/samples/python3.7/periodic.cfg", + ".kokoro/samples/python3.7/presubmit.cfg", + ".kokoro/samples/python3.8/common.cfg", + ".kokoro/samples/python3.8/continuous.cfg", + ".kokoro/samples/python3.8/periodic.cfg", + ".kokoro/samples/python3.8/presubmit.cfg", + ".kokoro/test-samples.sh", + ".kokoro/trampoline.sh", + ".kokoro/trampoline_v2.sh", + ".trampolinerc", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.rst", + "LICENSE", + "MANIFEST.in", + "docs/_static/custom.css", + "docs/_templates/layout.html", + "docs/conf.py", + "docs/documentai_v1beta2/services.rst", + "docs/documentai_v1beta2/types.rst", + "docs/gapic/v1beta3/api.rst", + "docs/gapic/v1beta3/types.rst", + "docs/multiprocessing.rst", + "google/__init__.py", + "google/cloud/__init__.py", + "google/cloud/documentai/__init__.py", + "google/cloud/documentai/py.typed", + "google/cloud/documentai/v1beta3.py", + "google/cloud/documentai/v1beta3/__init__.py", + "google/cloud/documentai/v1beta3/gapic/__init__.py", + "google/cloud/documentai/v1beta3/gapic/document_processor_service_client.py", + "google/cloud/documentai/v1beta3/gapic/document_processor_service_client_config.py", + "google/cloud/documentai/v1beta3/gapic/enums.py", + "google/cloud/documentai/v1beta3/gapic/transports/__init__.py", + "google/cloud/documentai/v1beta3/gapic/transports/document_processor_service_grpc_transport.py", + "google/cloud/documentai/v1beta3/types.py", + "google/cloud/documentai_v1beta2/__init__.py", + "google/cloud/documentai_v1beta2/py.typed", + "google/cloud/documentai_v1beta2/services/__init__.py", + "google/cloud/documentai_v1beta2/services/document_understanding_service/__init__.py", + "google/cloud/documentai_v1beta2/services/document_understanding_service/async_client.py", + "google/cloud/documentai_v1beta2/services/document_understanding_service/client.py", + "google/cloud/documentai_v1beta2/services/document_understanding_service/transports/__init__.py", + "google/cloud/documentai_v1beta2/services/document_understanding_service/transports/base.py", + "google/cloud/documentai_v1beta2/services/document_understanding_service/transports/grpc.py", + "google/cloud/documentai_v1beta2/services/document_understanding_service/transports/grpc_asyncio.py", + "google/cloud/documentai_v1beta2/types/__init__.py", + "google/cloud/documentai_v1beta2/types/document.py", + "google/cloud/documentai_v1beta2/types/document_understanding.py", + "google/cloud/documentai_v1beta2/types/geometry.py", + "google/cloud/documentai_v1beta3/proto/__init__.py", + "google/cloud/documentai_v1beta3/proto/document_pb2.py", + "google/cloud/documentai_v1beta3/proto/document_pb2_grpc.py", + "google/cloud/documentai_v1beta3/proto/document_processor_service_pb2.py", + "google/cloud/documentai_v1beta3/proto/document_processor_service_pb2_grpc.py", + "google/cloud/documentai_v1beta3/proto/geometry_pb2.py", + "google/cloud/documentai_v1beta3/proto/geometry_pb2_grpc.py", + "mypy.ini", + "noxfile.py", + "renovate.json", + "samples/AUTHORING_GUIDE.md", + "samples/CONTRIBUTING.md", + "scripts/decrypt-secrets.sh", + "scripts/fixup_documentai_v1beta2_keywords.py", + "scripts/readme-gen/readme_gen.py", + "scripts/readme-gen/templates/README.tmpl.rst", + "scripts/readme-gen/templates/auth.tmpl.rst", + "scripts/readme-gen/templates/auth_api_key.tmpl.rst", + "scripts/readme-gen/templates/install_deps.tmpl.rst", + "scripts/readme-gen/templates/install_portaudio.tmpl.rst", + "setup.cfg", + "testing/.gitignore", + "tests/unit/gapic/documentai_v1beta2/__init__.py", + "tests/unit/gapic/documentai_v1beta2/test_document_understanding_service.py", + "tests/unit/gapic/v1beta3/test_document_processor_service_client_v1beta3.py" ] } \ No newline at end of file diff --git a/tests/unit/gapic/v1beta3/test_document_processor_service_client_v1beta3.py b/tests/unit/gapic/v1beta3/test_document_processor_service_client_v1beta3.py new file mode 100644 index 00000000..7fb1ebd9 --- /dev/null +++ b/tests/unit/gapic/v1beta3/test_document_processor_service_client_v1beta3.py @@ -0,0 +1,215 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Unit tests.""" + +import mock +import pytest + +from google.rpc import status_pb2 + +from google.cloud.documentai import v1beta3 +from google.cloud.documentai.v1beta3.proto import document_processor_service_pb2 +from google.longrunning import operations_pb2 + + +class MultiCallableStub(object): + """Stub for the grpc.UnaryUnaryMultiCallable interface.""" + + def __init__(self, method, channel_stub): + self.method = method + self.channel_stub = channel_stub + + def __call__(self, request, timeout=None, metadata=None, credentials=None): + self.channel_stub.requests.append((self.method, request)) + + response = None + if self.channel_stub.responses: + response = self.channel_stub.responses.pop() + + if isinstance(response, Exception): + raise response + + if response: + return response + + +class ChannelStub(object): + """Stub for the grpc.Channel interface.""" + + def __init__(self, responses=[]): + self.responses = responses + self.requests = [] + + def unary_unary(self, method, request_serializer=None, response_deserializer=None): + return MultiCallableStub(method, self) + + +class CustomException(Exception): + pass + + +class TestDocumentProcessorServiceClient(object): + def test_process_document(self): + # Setup Expected Response + human_review_operation = "humanReviewOperation2074827282" + expected_response = {"human_review_operation": human_review_operation} + expected_response = document_processor_service_pb2.ProcessResponse( + **expected_response + ) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = v1beta3.DocumentProcessorServiceClient() + + # Setup Request + name = client.processor_path("[PROJECT]", "[LOCATION]", "[PROCESSOR]") + + response = client.process_document(name) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = document_processor_service_pb2.ProcessRequest(name=name) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_process_document_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = v1beta3.DocumentProcessorServiceClient() + + # Setup request + name = client.processor_path("[PROJECT]", "[LOCATION]", "[PROCESSOR]") + + with pytest.raises(CustomException): + client.process_document(name) + + def test_batch_process_documents(self): + # Setup Expected Response + expected_response = {} + expected_response = document_processor_service_pb2.BatchProcessResponse( + **expected_response + ) + operation = operations_pb2.Operation( + name="operations/test_batch_process_documents", done=True + ) + operation.response.Pack(expected_response) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = v1beta3.DocumentProcessorServiceClient() + + # Setup Request + name = client.processor_path("[PROJECT]", "[LOCATION]", "[PROCESSOR]") + + response = client.batch_process_documents(name) + result = response.result() + assert expected_response == result + + assert len(channel.requests) == 1 + expected_request = document_processor_service_pb2.BatchProcessRequest(name=name) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_batch_process_documents_exception(self): + # Setup Response + error = status_pb2.Status() + operation = operations_pb2.Operation( + name="operations/test_batch_process_documents_exception", done=True + ) + operation.error.CopyFrom(error) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = v1beta3.DocumentProcessorServiceClient() + + # Setup Request + name = client.processor_path("[PROJECT]", "[LOCATION]", "[PROCESSOR]") + + response = client.batch_process_documents(name) + exception = response.exception() + assert exception.errors[0] == error + + def test_review_document(self): + # Setup Expected Response + gcs_destination = "gcsDestination714819302" + expected_response = {"gcs_destination": gcs_destination} + expected_response = document_processor_service_pb2.ReviewDocumentResponse( + **expected_response + ) + operation = operations_pb2.Operation( + name="operations/test_review_document", done=True + ) + operation.response.Pack(expected_response) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = v1beta3.DocumentProcessorServiceClient() + + # Setup Request + human_review_config = client.human_review_config_path( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]" + ) + + response = client.review_document(human_review_config) + result = response.result() + assert expected_response == result + + assert len(channel.requests) == 1 + expected_request = document_processor_service_pb2.ReviewDocumentRequest( + human_review_config=human_review_config + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_review_document_exception(self): + # Setup Response + error = status_pb2.Status() + operation = operations_pb2.Operation( + name="operations/test_review_document_exception", done=True + ) + operation.error.CopyFrom(error) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = v1beta3.DocumentProcessorServiceClient() + + # Setup Request + human_review_config = client.human_review_config_path( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]" + ) + + response = client.review_document(human_review_config) + exception = response.exception() + assert exception.errors[0] == error From 69e258f2aa09a485599259f3ceef3ad8c980b591 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Thu, 1 Oct 2020 05:52:34 -0700 Subject: [PATCH 2/7] chore(python): use BUILD_SPECIFIC_GCLOUD_PROJECT for samples https://github.com/googleapis/python-talent/blob/ef045e8eb348db36d7a2a611e6f26b11530d273b/samples/snippets/noxfile_config.py#L27-L32 `BUILD_SPECIFIC_GCLOUD_PROJECT` is an alternate project used for sample tests that do poorly with concurrent runs on the same project. Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Source-Date: Wed Sep 30 13:06:03 2020 -0600 Source-Repo: googleapis/synthtool Source-Sha: 9b0da5204ab90bcc36f8cd4e5689eff1a54cc3e4 Source-Link: https://github.com/googleapis/synthtool/commit/9b0da5204ab90bcc36f8cd4e5689eff1a54cc3e4 --- .kokoro/samples/python3.6/common.cfg | 6 ++++++ .kokoro/samples/python3.7/common.cfg | 6 ++++++ .kokoro/samples/python3.8/common.cfg | 6 ++++++ synth.metadata | 4 ++-- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.kokoro/samples/python3.6/common.cfg b/.kokoro/samples/python3.6/common.cfg index f754d781..a042a54a 100644 --- a/.kokoro/samples/python3.6/common.cfg +++ b/.kokoro/samples/python3.6/common.cfg @@ -13,6 +13,12 @@ env_vars: { value: "py-3.6" } +# Declare build specific Cloud project. +env_vars: { + key: "BUILD_SPECIFIC_GCLOUD_PROJECT" + value: "python-docs-samples-tests-py36" +} + env_vars: { key: "TRAMPOLINE_BUILD_FILE" value: "github/python-documentai/.kokoro/test-samples.sh" diff --git a/.kokoro/samples/python3.7/common.cfg b/.kokoro/samples/python3.7/common.cfg index ac8e6e0a..10b51166 100644 --- a/.kokoro/samples/python3.7/common.cfg +++ b/.kokoro/samples/python3.7/common.cfg @@ -13,6 +13,12 @@ env_vars: { value: "py-3.7" } +# Declare build specific Cloud project. +env_vars: { + key: "BUILD_SPECIFIC_GCLOUD_PROJECT" + value: "python-docs-samples-tests-py37" +} + env_vars: { key: "TRAMPOLINE_BUILD_FILE" value: "github/python-documentai/.kokoro/test-samples.sh" diff --git a/.kokoro/samples/python3.8/common.cfg b/.kokoro/samples/python3.8/common.cfg index 72a772e8..9a69601d 100644 --- a/.kokoro/samples/python3.8/common.cfg +++ b/.kokoro/samples/python3.8/common.cfg @@ -13,6 +13,12 @@ env_vars: { value: "py-3.8" } +# Declare build specific Cloud project. +env_vars: { + key: "BUILD_SPECIFIC_GCLOUD_PROJECT" + value: "python-docs-samples-tests-py38" +} + env_vars: { key: "TRAMPOLINE_BUILD_FILE" value: "github/python-documentai/.kokoro/test-samples.sh" diff --git a/synth.metadata b/synth.metadata index ffff661b..05e6e427 100644 --- a/synth.metadata +++ b/synth.metadata @@ -19,14 +19,14 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "e6168630be3e31eede633ba2c6f1cd64248dec1c" + "sha": "9b0da5204ab90bcc36f8cd4e5689eff1a54cc3e4" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "e6168630be3e31eede633ba2c6f1cd64248dec1c" + "sha": "9b0da5204ab90bcc36f8cd4e5689eff1a54cc3e4" } } ], From 0547c2a7abe7fbf8e254f3f935ca7ec675ee20ac Mon Sep 17 00:00:00 2001 From: Bu Sun Kim Date: Wed, 18 Nov 2020 00:29:08 +0000 Subject: [PATCH 3/7] chore: manual regen --- .kokoro/docs/common.cfg | 2 +- .kokoro/test-samples.sh | 8 +- CODE_OF_CONDUCT.md | 123 +++++--- docs/conf.py | 1 + docs/documentai_v1beta2/types.rst | 1 + docs/documentai_v1beta3/types.rst | 1 + google/cloud/documentai/__init__.py | 68 +++++ .../async_client.py | 55 +++- .../document_understanding_service/client.py | 80 +++++- .../transports/base.py | 4 +- .../transports/grpc.py | 18 +- .../transports/grpc_asyncio.py | 4 + .../documentai_v1beta2/types/geometry.py | 4 +- .../async_client.py | 68 ++++- .../document_processor_service/client.py | 108 ++++++- .../transports/base.py | 6 +- .../transports/grpc.py | 18 +- .../transports/grpc_asyncio.py | 4 + .../documentai_v1beta3/types/geometry.py | 4 +- noxfile.py | 6 +- scripts/fixup_documentai_v1beta2_keywords.py | 1 + scripts/fixup_documentai_v1beta3_keywords.py | 1 + synth.metadata | 122 +------- .../test_document_understanding_service.py | 181 +++++++++--- .../test_document_processor_service.py | 271 ++++++++++++++---- 25 files changed, 868 insertions(+), 291 deletions(-) diff --git a/.kokoro/docs/common.cfg b/.kokoro/docs/common.cfg index fcc98d5e..c90da11c 100644 --- a/.kokoro/docs/common.cfg +++ b/.kokoro/docs/common.cfg @@ -30,7 +30,7 @@ env_vars: { env_vars: { key: "V2_STAGING_BUCKET" - value: "docs-staging-v2-staging" + value: "docs-staging-v2" } # It will upload the docker image after successful builds. diff --git a/.kokoro/test-samples.sh b/.kokoro/test-samples.sh index 557116a9..f97019c6 100755 --- a/.kokoro/test-samples.sh +++ b/.kokoro/test-samples.sh @@ -28,6 +28,12 @@ if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then git checkout $LATEST_RELEASE fi +# Exit early if samples directory doesn't exist +if [ ! -d "./samples" ]; then + echo "No tests run. `./samples` not found" + exit 0 +fi + # Disable buffering, so that the logs stream through. export PYTHONUNBUFFERED=1 @@ -101,4 +107,4 @@ cd "$ROOT" # Workaround for Kokoro permissions issue: delete secrets rm testing/{test-env.sh,client-secrets.json,service-account.json} -exit "$RTN" \ No newline at end of file +exit "$RTN" diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index b3d1f602..039f4368 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,44 +1,95 @@ -# Contributor Code of Conduct +# Code of Conduct -As contributors and maintainers of this project, -and in the interest of fostering an open and welcoming community, -we pledge to respect all people who contribute through reporting issues, -posting feature requests, updating documentation, -submitting pull requests or patches, and other activities. +## Our Pledge -We are committed to making participation in this project -a harassment-free experience for everyone, -regardless of level of experience, gender, gender identity and expression, -sexual orientation, disability, personal appearance, -body size, race, ethnicity, age, religion, or nationality. +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members Examples of unacceptable behavior by participants include: -* The use of sexualized language or imagery -* Personal attacks -* Trolling or insulting/derogatory comments -* Public or private harassment -* Publishing other's private information, -such as physical or electronic -addresses, without explicit permission -* Other unethical or unprofessional conduct. +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct. -By adopting this Code of Conduct, -project maintainers commit themselves to fairly and consistently -applying these principles to every aspect of managing this project. -Project maintainers who do not follow or enforce the Code of Conduct -may be permanently removed from the project team. - -This code of conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. - -Instances of abusive, harassing, or otherwise unacceptable behavior -may be reported by opening an issue -or contacting one or more of the project maintainers. - -This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, -available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index d5ee4abd..6d80d2bf 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -349,6 +349,7 @@ "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,), "grpc": ("https://grpc.io/grpc/python/", None), + "proto-plus": ("https://proto-plus-python.readthedocs.io/en/latest/", None), } diff --git a/docs/documentai_v1beta2/types.rst b/docs/documentai_v1beta2/types.rst index 2a437e9d..35540dd0 100644 --- a/docs/documentai_v1beta2/types.rst +++ b/docs/documentai_v1beta2/types.rst @@ -3,3 +3,4 @@ Types for Google Cloud Documentai v1beta2 API .. automodule:: google.cloud.documentai_v1beta2.types :members: + :show-inheritance: diff --git a/docs/documentai_v1beta3/types.rst b/docs/documentai_v1beta3/types.rst index 03bcbfa7..31b489da 100644 --- a/docs/documentai_v1beta3/types.rst +++ b/docs/documentai_v1beta3/types.rst @@ -3,3 +3,4 @@ Types for Google Cloud Documentai v1beta3 API .. automodule:: google.cloud.documentai_v1beta3.types :members: + :show-inheritance: diff --git a/google/cloud/documentai/__init__.py b/google/cloud/documentai/__init__.py index e69de29b..edd80431 100644 --- a/google/cloud/documentai/__init__.py +++ b/google/cloud/documentai/__init__.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- + +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from google.cloud.documentai_v1beta3.services.document_processor_service.async_client import ( + DocumentProcessorServiceAsyncClient, +) +from google.cloud.documentai_v1beta3.services.document_processor_service.client import ( + DocumentProcessorServiceClient, +) +from google.cloud.documentai_v1beta3.types.document import Document +from google.cloud.documentai_v1beta3.types.document_processor_service import ( + BatchProcessMetadata, +) +from google.cloud.documentai_v1beta3.types.document_processor_service import ( + BatchProcessRequest, +) +from google.cloud.documentai_v1beta3.types.document_processor_service import ( + BatchProcessResponse, +) +from google.cloud.documentai_v1beta3.types.document_processor_service import ( + ProcessRequest, +) +from google.cloud.documentai_v1beta3.types.document_processor_service import ( + ProcessResponse, +) +from google.cloud.documentai_v1beta3.types.document_processor_service import ( + ReviewDocumentOperationMetadata, +) +from google.cloud.documentai_v1beta3.types.document_processor_service import ( + ReviewDocumentRequest, +) +from google.cloud.documentai_v1beta3.types.document_processor_service import ( + ReviewDocumentResponse, +) +from google.cloud.documentai_v1beta3.types.geometry import BoundingPoly +from google.cloud.documentai_v1beta3.types.geometry import NormalizedVertex +from google.cloud.documentai_v1beta3.types.geometry import Vertex + +__all__ = ( + "BatchProcessMetadata", + "BatchProcessRequest", + "BatchProcessResponse", + "BoundingPoly", + "Document", + "DocumentProcessorServiceAsyncClient", + "DocumentProcessorServiceClient", + "NormalizedVertex", + "ProcessRequest", + "ProcessResponse", + "ReviewDocumentOperationMetadata", + "ReviewDocumentRequest", + "ReviewDocumentResponse", + "Vertex", +) diff --git a/google/cloud/documentai_v1beta2/services/document_understanding_service/async_client.py b/google/cloud/documentai_v1beta2/services/document_understanding_service/async_client.py index a293e4b2..c961662b 100644 --- a/google/cloud/documentai_v1beta2/services/document_understanding_service/async_client.py +++ b/google/cloud/documentai_v1beta2/services/document_understanding_service/async_client.py @@ -50,11 +50,55 @@ class DocumentUnderstandingServiceAsyncClient: DEFAULT_ENDPOINT = DocumentUnderstandingServiceClient.DEFAULT_ENDPOINT DEFAULT_MTLS_ENDPOINT = DocumentUnderstandingServiceClient.DEFAULT_MTLS_ENDPOINT + common_billing_account_path = staticmethod( + DocumentUnderstandingServiceClient.common_billing_account_path + ) + parse_common_billing_account_path = staticmethod( + DocumentUnderstandingServiceClient.parse_common_billing_account_path + ) + + common_folder_path = staticmethod( + DocumentUnderstandingServiceClient.common_folder_path + ) + parse_common_folder_path = staticmethod( + DocumentUnderstandingServiceClient.parse_common_folder_path + ) + + common_organization_path = staticmethod( + DocumentUnderstandingServiceClient.common_organization_path + ) + parse_common_organization_path = staticmethod( + DocumentUnderstandingServiceClient.parse_common_organization_path + ) + + common_project_path = staticmethod( + DocumentUnderstandingServiceClient.common_project_path + ) + parse_common_project_path = staticmethod( + DocumentUnderstandingServiceClient.parse_common_project_path + ) + + common_location_path = staticmethod( + DocumentUnderstandingServiceClient.common_location_path + ) + parse_common_location_path = staticmethod( + DocumentUnderstandingServiceClient.parse_common_location_path + ) + from_service_account_file = ( DocumentUnderstandingServiceClient.from_service_account_file ) from_service_account_json = from_service_account_file + @property + def transport(self) -> DocumentUnderstandingServiceTransport: + """Return the transport used by the client instance. + + Returns: + DocumentUnderstandingServiceTransport: The transport used by the client instance. + """ + return self._client.transport + get_transport_class = functools.partial( type(DocumentUnderstandingServiceClient).get_transport_class, type(DocumentUnderstandingServiceClient), @@ -152,7 +196,8 @@ async def batch_process_documents( # Create or coerce a protobuf request object. # Sanity check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. - if request is not None and any([requests]): + has_flattened_params = any([requests]) + if request is not None and has_flattened_params: raise ValueError( "If the `request` argument is set, then none of " "the individual field arguments should be set." @@ -163,8 +208,8 @@ async def batch_process_documents( # If we have keyword arguments corresponding to fields on the # request, apply these. - if requests is not None: - request.requests = requests + if requests: + request.requests.extend(requests) # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. @@ -175,7 +220,7 @@ async def batch_process_documents( maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.ServiceUnavailable, exceptions.DeadlineExceeded, + exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), ), default_timeout=120.0, @@ -246,7 +291,7 @@ async def process_document( maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.ServiceUnavailable, exceptions.DeadlineExceeded, + exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), ), default_timeout=120.0, diff --git a/google/cloud/documentai_v1beta2/services/document_understanding_service/client.py b/google/cloud/documentai_v1beta2/services/document_understanding_service/client.py index 433de5c1..0d740e5b 100644 --- a/google/cloud/documentai_v1beta2/services/document_understanding_service/client.py +++ b/google/cloud/documentai_v1beta2/services/document_understanding_service/client.py @@ -142,6 +142,74 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): from_service_account_json = from_service_account_file + @property + def transport(self) -> DocumentUnderstandingServiceTransport: + """Return the transport used by the client instance. + + Returns: + DocumentUnderstandingServiceTransport: The transport used by the client instance. + """ + return self._transport + + @staticmethod + def common_billing_account_path(billing_account: str,) -> str: + """Return a fully-qualified billing_account string.""" + return "billingAccounts/{billing_account}".format( + billing_account=billing_account, + ) + + @staticmethod + def parse_common_billing_account_path(path: str) -> Dict[str, str]: + """Parse a billing_account path into its component segments.""" + m = re.match(r"^billingAccounts/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_folder_path(folder: str,) -> str: + """Return a fully-qualified folder string.""" + return "folders/{folder}".format(folder=folder,) + + @staticmethod + def parse_common_folder_path(path: str) -> Dict[str, str]: + """Parse a folder path into its component segments.""" + m = re.match(r"^folders/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_organization_path(organization: str,) -> str: + """Return a fully-qualified organization string.""" + return "organizations/{organization}".format(organization=organization,) + + @staticmethod + def parse_common_organization_path(path: str) -> Dict[str, str]: + """Parse a organization path into its component segments.""" + m = re.match(r"^organizations/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_project_path(project: str,) -> str: + """Return a fully-qualified project string.""" + return "projects/{project}".format(project=project,) + + @staticmethod + def parse_common_project_path(path: str) -> Dict[str, str]: + """Parse a project path into its component segments.""" + m = re.match(r"^projects/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_location_path(project: str, location: str,) -> str: + """Return a fully-qualified location string.""" + return "projects/{project}/locations/{location}".format( + project=project, location=location, + ) + + @staticmethod + def parse_common_location_path(path: str) -> Dict[str, str]: + """Parse a location path into its component segments.""" + m = re.match(r"^projects/(?P.+?)/locations/(?P.+?)$", path) + return m.groupdict() if m else {} + def __init__( self, *, @@ -177,10 +245,10 @@ def __init__( not provided, the default SSL client certificate will be used if present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not set, no client certificate will be used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing your own client library. Raises: @@ -320,8 +388,8 @@ def batch_process_documents( # If we have keyword arguments corresponding to fields on the # request, apply these. - if requests is not None: - request.requests = requests + if requests: + request.requests.extend(requests) # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. diff --git a/google/cloud/documentai_v1beta2/services/document_understanding_service/transports/base.py b/google/cloud/documentai_v1beta2/services/document_understanding_service/transports/base.py index df52dbcc..547c5803 100644 --- a/google/cloud/documentai_v1beta2/services/document_understanding_service/transports/base.py +++ b/google/cloud/documentai_v1beta2/services/document_understanding_service/transports/base.py @@ -116,7 +116,7 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.ServiceUnavailable, exceptions.DeadlineExceeded, + exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), ), default_timeout=120.0, @@ -129,7 +129,7 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.ServiceUnavailable, exceptions.DeadlineExceeded, + exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), ), default_timeout=120.0, diff --git a/google/cloud/documentai_v1beta2/services/document_understanding_service/transports/grpc.py b/google/cloud/documentai_v1beta2/services/document_understanding_service/transports/grpc.py index 60f3e8b8..0390ff51 100644 --- a/google/cloud/documentai_v1beta2/services/document_understanding_service/transports/grpc.py +++ b/google/cloud/documentai_v1beta2/services/document_understanding_service/transports/grpc.py @@ -94,10 +94,10 @@ def __init__( for grpc channel. It is ignored if ``channel`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing your own client library. Raises: @@ -106,6 +106,8 @@ def __init__( google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials`` and ``credentials_file`` are passed. """ + self._ssl_channel_credentials = ssl_channel_credentials + if channel: # Sanity check: Ensure that channel and credentials are not both # provided. @@ -113,6 +115,7 @@ def __init__( # If a channel was explicitly provided, set it. self._grpc_channel = channel + self._ssl_channel_credentials = None elif api_mtls_endpoint: warnings.warn( "api_mtls_endpoint and client_cert_source are deprecated", @@ -149,6 +152,7 @@ def __init__( scopes=scopes or self.AUTH_SCOPES, quota_project_id=quota_project_id, ) + self._ssl_channel_credentials = ssl_credentials else: host = host if ":" in host else host + ":443" @@ -226,12 +230,8 @@ def create_channel( @property def grpc_channel(self) -> grpc.Channel: - """Create the channel designed to connect to this service. - - This property caches on the instance; repeated calls return - the same channel. + """Return the channel designed to connect to this service. """ - # Return the channel from cache. return self._grpc_channel @property diff --git a/google/cloud/documentai_v1beta2/services/document_understanding_service/transports/grpc_asyncio.py b/google/cloud/documentai_v1beta2/services/document_understanding_service/transports/grpc_asyncio.py index 315795e5..95122515 100644 --- a/google/cloud/documentai_v1beta2/services/document_understanding_service/transports/grpc_asyncio.py +++ b/google/cloud/documentai_v1beta2/services/document_understanding_service/transports/grpc_asyncio.py @@ -153,6 +153,8 @@ def __init__( google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials`` and ``credentials_file`` are passed. """ + self._ssl_channel_credentials = ssl_channel_credentials + if channel: # Sanity check: Ensure that channel and credentials are not both # provided. @@ -160,6 +162,7 @@ def __init__( # If a channel was explicitly provided, set it. self._grpc_channel = channel + self._ssl_channel_credentials = None elif api_mtls_endpoint: warnings.warn( "api_mtls_endpoint and client_cert_source are deprecated", @@ -196,6 +199,7 @@ def __init__( scopes=scopes or self.AUTH_SCOPES, quota_project_id=quota_project_id, ) + self._ssl_channel_credentials = ssl_credentials else: host = host if ":" in host else host + ":443" diff --git a/google/cloud/documentai_v1beta2/types/geometry.py b/google/cloud/documentai_v1beta2/types/geometry.py index 12d63f90..0592f336 100644 --- a/google/cloud/documentai_v1beta2/types/geometry.py +++ b/google/cloud/documentai_v1beta2/types/geometry.py @@ -68,10 +68,10 @@ class BoundingPoly(proto.Message): The bounding polygon normalized vertices. """ - vertices = proto.RepeatedField(proto.MESSAGE, number=1, message=Vertex,) + vertices = proto.RepeatedField(proto.MESSAGE, number=1, message="Vertex",) normalized_vertices = proto.RepeatedField( - proto.MESSAGE, number=2, message=NormalizedVertex, + proto.MESSAGE, number=2, message="NormalizedVertex", ) diff --git a/google/cloud/documentai_v1beta3/services/document_processor_service/async_client.py b/google/cloud/documentai_v1beta3/services/document_processor_service/async_client.py index 7ba80ac2..467b072a 100644 --- a/google/cloud/documentai_v1beta3/services/document_processor_service/async_client.py +++ b/google/cloud/documentai_v1beta3/services/document_processor_service/async_client.py @@ -51,9 +51,62 @@ class DocumentProcessorServiceAsyncClient: DEFAULT_ENDPOINT = DocumentProcessorServiceClient.DEFAULT_ENDPOINT DEFAULT_MTLS_ENDPOINT = DocumentProcessorServiceClient.DEFAULT_MTLS_ENDPOINT + human_review_config_path = staticmethod( + DocumentProcessorServiceClient.human_review_config_path + ) + parse_human_review_config_path = staticmethod( + DocumentProcessorServiceClient.parse_human_review_config_path + ) + processor_path = staticmethod(DocumentProcessorServiceClient.processor_path) + parse_processor_path = staticmethod( + DocumentProcessorServiceClient.parse_processor_path + ) + + common_billing_account_path = staticmethod( + DocumentProcessorServiceClient.common_billing_account_path + ) + parse_common_billing_account_path = staticmethod( + DocumentProcessorServiceClient.parse_common_billing_account_path + ) + + common_folder_path = staticmethod(DocumentProcessorServiceClient.common_folder_path) + parse_common_folder_path = staticmethod( + DocumentProcessorServiceClient.parse_common_folder_path + ) + + common_organization_path = staticmethod( + DocumentProcessorServiceClient.common_organization_path + ) + parse_common_organization_path = staticmethod( + DocumentProcessorServiceClient.parse_common_organization_path + ) + + common_project_path = staticmethod( + DocumentProcessorServiceClient.common_project_path + ) + parse_common_project_path = staticmethod( + DocumentProcessorServiceClient.parse_common_project_path + ) + + common_location_path = staticmethod( + DocumentProcessorServiceClient.common_location_path + ) + parse_common_location_path = staticmethod( + DocumentProcessorServiceClient.parse_common_location_path + ) + from_service_account_file = DocumentProcessorServiceClient.from_service_account_file from_service_account_json = from_service_account_file + @property + def transport(self) -> DocumentProcessorServiceTransport: + """Return the transport used by the client instance. + + Returns: + DocumentProcessorServiceTransport: The transport used by the client instance. + """ + return self._client.transport + get_transport_class = functools.partial( type(DocumentProcessorServiceClient).get_transport_class, type(DocumentProcessorServiceClient), @@ -144,7 +197,8 @@ async def process_document( # Create or coerce a protobuf request object. # Sanity check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. - if request is not None and any([name]): + has_flattened_params = any([name]) + if request is not None and has_flattened_params: raise ValueError( "If the `request` argument is set, then none of " "the individual field arguments should be set." @@ -167,7 +221,7 @@ async def process_document( maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.ServiceUnavailable, exceptions.DeadlineExceeded, + exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), ), default_timeout=120.0, @@ -227,7 +281,8 @@ async def batch_process_documents( # Create or coerce a protobuf request object. # Sanity check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. - if request is not None and any([name]): + has_flattened_params = any([name]) + if request is not None and has_flattened_params: raise ValueError( "If the `request` argument is set, then none of " "the individual field arguments should be set." @@ -250,7 +305,7 @@ async def batch_process_documents( maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.ServiceUnavailable, exceptions.DeadlineExceeded, + exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), ), default_timeout=120.0, @@ -319,7 +374,8 @@ async def review_document( # Create or coerce a protobuf request object. # Sanity check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. - if request is not None and any([human_review_config]): + has_flattened_params = any([human_review_config]) + if request is not None and has_flattened_params: raise ValueError( "If the `request` argument is set, then none of " "the individual field arguments should be set." @@ -342,7 +398,7 @@ async def review_document( maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.ServiceUnavailable, exceptions.DeadlineExceeded, + exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), ), default_timeout=120.0, diff --git a/google/cloud/documentai_v1beta3/services/document_processor_service/client.py b/google/cloud/documentai_v1beta3/services/document_processor_service/client.py index 84b57f36..e621e251 100644 --- a/google/cloud/documentai_v1beta3/services/document_processor_service/client.py +++ b/google/cloud/documentai_v1beta3/services/document_processor_service/client.py @@ -139,6 +139,106 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): from_service_account_json = from_service_account_file + @property + def transport(self) -> DocumentProcessorServiceTransport: + """Return the transport used by the client instance. + + Returns: + DocumentProcessorServiceTransport: The transport used by the client instance. + """ + return self._transport + + @staticmethod + def human_review_config_path(project: str, location: str, processor: str,) -> str: + """Return a fully-qualified human_review_config string.""" + return "projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig".format( + project=project, location=location, processor=processor, + ) + + @staticmethod + def parse_human_review_config_path(path: str) -> Dict[str, str]: + """Parse a human_review_config path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/processors/(?P.+?)/humanReviewConfig$", + path, + ) + return m.groupdict() if m else {} + + @staticmethod + def processor_path(project: str, location: str, processor: str,) -> str: + """Return a fully-qualified processor string.""" + return "projects/{project}/locations/{location}/processors/{processor}".format( + project=project, location=location, processor=processor, + ) + + @staticmethod + def parse_processor_path(path: str) -> Dict[str, str]: + """Parse a processor path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/processors/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + + @staticmethod + def common_billing_account_path(billing_account: str,) -> str: + """Return a fully-qualified billing_account string.""" + return "billingAccounts/{billing_account}".format( + billing_account=billing_account, + ) + + @staticmethod + def parse_common_billing_account_path(path: str) -> Dict[str, str]: + """Parse a billing_account path into its component segments.""" + m = re.match(r"^billingAccounts/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_folder_path(folder: str,) -> str: + """Return a fully-qualified folder string.""" + return "folders/{folder}".format(folder=folder,) + + @staticmethod + def parse_common_folder_path(path: str) -> Dict[str, str]: + """Parse a folder path into its component segments.""" + m = re.match(r"^folders/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_organization_path(organization: str,) -> str: + """Return a fully-qualified organization string.""" + return "organizations/{organization}".format(organization=organization,) + + @staticmethod + def parse_common_organization_path(path: str) -> Dict[str, str]: + """Parse a organization path into its component segments.""" + m = re.match(r"^organizations/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_project_path(project: str,) -> str: + """Return a fully-qualified project string.""" + return "projects/{project}".format(project=project,) + + @staticmethod + def parse_common_project_path(path: str) -> Dict[str, str]: + """Parse a project path into its component segments.""" + m = re.match(r"^projects/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_location_path(project: str, location: str,) -> str: + """Return a fully-qualified location string.""" + return "projects/{project}/locations/{location}".format( + project=project, location=location, + ) + + @staticmethod + def parse_common_location_path(path: str) -> Dict[str, str]: + """Parse a location path into its component segments.""" + m = re.match(r"^projects/(?P.+?)/locations/(?P.+?)$", path) + return m.groupdict() if m else {} + def __init__( self, *, @@ -174,10 +274,10 @@ def __init__( not provided, the default SSL client certificate will be used if present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not set, no client certificate will be used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing your own client library. Raises: diff --git a/google/cloud/documentai_v1beta3/services/document_processor_service/transports/base.py b/google/cloud/documentai_v1beta3/services/document_processor_service/transports/base.py index dfa32e24..e24d4922 100644 --- a/google/cloud/documentai_v1beta3/services/document_processor_service/transports/base.py +++ b/google/cloud/documentai_v1beta3/services/document_processor_service/transports/base.py @@ -115,7 +115,7 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.ServiceUnavailable, exceptions.DeadlineExceeded, + exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), ), default_timeout=120.0, @@ -128,7 +128,7 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.ServiceUnavailable, exceptions.DeadlineExceeded, + exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), ), default_timeout=120.0, @@ -141,7 +141,7 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.ServiceUnavailable, exceptions.DeadlineExceeded, + exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), ), default_timeout=120.0, diff --git a/google/cloud/documentai_v1beta3/services/document_processor_service/transports/grpc.py b/google/cloud/documentai_v1beta3/services/document_processor_service/transports/grpc.py index d7220126..435767b0 100644 --- a/google/cloud/documentai_v1beta3/services/document_processor_service/transports/grpc.py +++ b/google/cloud/documentai_v1beta3/services/document_processor_service/transports/grpc.py @@ -95,10 +95,10 @@ def __init__( for grpc channel. It is ignored if ``channel`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing your own client library. Raises: @@ -107,6 +107,8 @@ def __init__( google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials`` and ``credentials_file`` are passed. """ + self._ssl_channel_credentials = ssl_channel_credentials + if channel: # Sanity check: Ensure that channel and credentials are not both # provided. @@ -114,6 +116,7 @@ def __init__( # If a channel was explicitly provided, set it. self._grpc_channel = channel + self._ssl_channel_credentials = None elif api_mtls_endpoint: warnings.warn( "api_mtls_endpoint and client_cert_source are deprecated", @@ -150,6 +153,7 @@ def __init__( scopes=scopes or self.AUTH_SCOPES, quota_project_id=quota_project_id, ) + self._ssl_channel_credentials = ssl_credentials else: host = host if ":" in host else host + ":443" @@ -227,12 +231,8 @@ def create_channel( @property def grpc_channel(self) -> grpc.Channel: - """Create the channel designed to connect to this service. - - This property caches on the instance; repeated calls return - the same channel. + """Return the channel designed to connect to this service. """ - # Return the channel from cache. return self._grpc_channel @property diff --git a/google/cloud/documentai_v1beta3/services/document_processor_service/transports/grpc_asyncio.py b/google/cloud/documentai_v1beta3/services/document_processor_service/transports/grpc_asyncio.py index 391819cf..df9be8a8 100644 --- a/google/cloud/documentai_v1beta3/services/document_processor_service/transports/grpc_asyncio.py +++ b/google/cloud/documentai_v1beta3/services/document_processor_service/transports/grpc_asyncio.py @@ -152,6 +152,8 @@ def __init__( google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials`` and ``credentials_file`` are passed. """ + self._ssl_channel_credentials = ssl_channel_credentials + if channel: # Sanity check: Ensure that channel and credentials are not both # provided. @@ -159,6 +161,7 @@ def __init__( # If a channel was explicitly provided, set it. self._grpc_channel = channel + self._ssl_channel_credentials = None elif api_mtls_endpoint: warnings.warn( "api_mtls_endpoint and client_cert_source are deprecated", @@ -195,6 +198,7 @@ def __init__( scopes=scopes or self.AUTH_SCOPES, quota_project_id=quota_project_id, ) + self._ssl_channel_credentials = ssl_credentials else: host = host if ":" in host else host + ":443" diff --git a/google/cloud/documentai_v1beta3/types/geometry.py b/google/cloud/documentai_v1beta3/types/geometry.py index e87b87c7..b72dab75 100644 --- a/google/cloud/documentai_v1beta3/types/geometry.py +++ b/google/cloud/documentai_v1beta3/types/geometry.py @@ -68,10 +68,10 @@ class BoundingPoly(proto.Message): The bounding polygon normalized vertices. """ - vertices = proto.RepeatedField(proto.MESSAGE, number=1, message=Vertex,) + vertices = proto.RepeatedField(proto.MESSAGE, number=1, message="Vertex",) normalized_vertices = proto.RepeatedField( - proto.MESSAGE, number=2, message=NormalizedVertex, + proto.MESSAGE, number=2, message="NormalizedVertex", ) diff --git a/noxfile.py b/noxfile.py index e446dd8d..d531ac69 100644 --- a/noxfile.py +++ b/noxfile.py @@ -28,7 +28,7 @@ DEFAULT_PYTHON_VERSION = "3.8" SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"] -UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8"] +UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] @nox.session(python=DEFAULT_PYTHON_VERSION) @@ -72,7 +72,9 @@ def default(session): # Install all test dependencies, then install this package in-place. session.install("asyncmock", "pytest-asyncio") - session.install("mock", "pytest", "pytest-cov") + session.install( + "mock", "pytest", "pytest-cov", + ) session.install("-e", ".") # Run py.test against the unit tests. diff --git a/scripts/fixup_documentai_v1beta2_keywords.py b/scripts/fixup_documentai_v1beta2_keywords.py index 0cb9fcbf..d2f24146 100644 --- a/scripts/fixup_documentai_v1beta2_keywords.py +++ b/scripts/fixup_documentai_v1beta2_keywords.py @@ -1,3 +1,4 @@ +#! /usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2020 Google LLC diff --git a/scripts/fixup_documentai_v1beta3_keywords.py b/scripts/fixup_documentai_v1beta3_keywords.py index 2b689522..750630f1 100644 --- a/scripts/fixup_documentai_v1beta3_keywords.py +++ b/scripts/fixup_documentai_v1beta3_keywords.py @@ -1,3 +1,4 @@ +#! /usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2020 Google LLC diff --git a/synth.metadata b/synth.metadata index 05e6e427..45f9c253 100644 --- a/synth.metadata +++ b/synth.metadata @@ -3,30 +3,30 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/python-documentai.git", - "sha": "23223987206f190d0333a0b379827fa4253d0f97" + "remote": "git@github.com:googleapis/python-documentai", + "sha": "69e258f2aa09a485599259f3ceef3ad8c980b591" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "cb7fc620590382a4a2ea6ffdf6f51ae0e77bbbb5", - "internalRef": "334682521" + "sha": "e3e7e7ddb0fecd7bc61ca03b5a9ddb29cc9b48d8", + "internalRef": "342967619" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "9b0da5204ab90bcc36f8cd4e5689eff1a54cc3e4" + "sha": "7fcc405a579d5d53a726ff3da1b7c8c08f0f2d58" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "9b0da5204ab90bcc36f8cd4e5689eff1a54cc3e4" + "sha": "7fcc405a579d5d53a726ff3da1b7c8c08f0f2d58" } } ], @@ -49,115 +49,5 @@ "generator": "bazel" } } - ], - "generatedFiles": [ - ".flake8", - ".github/CONTRIBUTING.md", - ".github/ISSUE_TEMPLATE/bug_report.md", - ".github/ISSUE_TEMPLATE/feature_request.md", - ".github/ISSUE_TEMPLATE/support_request.md", - ".github/PULL_REQUEST_TEMPLATE.md", - ".github/release-please.yml", - ".github/snippet-bot.yml", - ".gitignore", - ".kokoro/build.sh", - ".kokoro/continuous/common.cfg", - ".kokoro/continuous/continuous.cfg", - ".kokoro/docker/docs/Dockerfile", - ".kokoro/docker/docs/fetch_gpg_keys.sh", - ".kokoro/docs/common.cfg", - ".kokoro/docs/docs-presubmit.cfg", - ".kokoro/docs/docs.cfg", - ".kokoro/populate-secrets.sh", - ".kokoro/presubmit/common.cfg", - ".kokoro/presubmit/presubmit.cfg", - ".kokoro/publish-docs.sh", - ".kokoro/release.sh", - ".kokoro/release/common.cfg", - ".kokoro/release/release.cfg", - ".kokoro/samples/lint/common.cfg", - ".kokoro/samples/lint/continuous.cfg", - ".kokoro/samples/lint/periodic.cfg", - ".kokoro/samples/lint/presubmit.cfg", - ".kokoro/samples/python3.6/common.cfg", - ".kokoro/samples/python3.6/continuous.cfg", - ".kokoro/samples/python3.6/periodic.cfg", - ".kokoro/samples/python3.6/presubmit.cfg", - ".kokoro/samples/python3.7/common.cfg", - ".kokoro/samples/python3.7/continuous.cfg", - ".kokoro/samples/python3.7/periodic.cfg", - ".kokoro/samples/python3.7/presubmit.cfg", - ".kokoro/samples/python3.8/common.cfg", - ".kokoro/samples/python3.8/continuous.cfg", - ".kokoro/samples/python3.8/periodic.cfg", - ".kokoro/samples/python3.8/presubmit.cfg", - ".kokoro/test-samples.sh", - ".kokoro/trampoline.sh", - ".kokoro/trampoline_v2.sh", - ".trampolinerc", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.rst", - "LICENSE", - "MANIFEST.in", - "docs/_static/custom.css", - "docs/_templates/layout.html", - "docs/conf.py", - "docs/documentai_v1beta2/services.rst", - "docs/documentai_v1beta2/types.rst", - "docs/gapic/v1beta3/api.rst", - "docs/gapic/v1beta3/types.rst", - "docs/multiprocessing.rst", - "google/__init__.py", - "google/cloud/__init__.py", - "google/cloud/documentai/__init__.py", - "google/cloud/documentai/py.typed", - "google/cloud/documentai/v1beta3.py", - "google/cloud/documentai/v1beta3/__init__.py", - "google/cloud/documentai/v1beta3/gapic/__init__.py", - "google/cloud/documentai/v1beta3/gapic/document_processor_service_client.py", - "google/cloud/documentai/v1beta3/gapic/document_processor_service_client_config.py", - "google/cloud/documentai/v1beta3/gapic/enums.py", - "google/cloud/documentai/v1beta3/gapic/transports/__init__.py", - "google/cloud/documentai/v1beta3/gapic/transports/document_processor_service_grpc_transport.py", - "google/cloud/documentai/v1beta3/types.py", - "google/cloud/documentai_v1beta2/__init__.py", - "google/cloud/documentai_v1beta2/py.typed", - "google/cloud/documentai_v1beta2/services/__init__.py", - "google/cloud/documentai_v1beta2/services/document_understanding_service/__init__.py", - "google/cloud/documentai_v1beta2/services/document_understanding_service/async_client.py", - "google/cloud/documentai_v1beta2/services/document_understanding_service/client.py", - "google/cloud/documentai_v1beta2/services/document_understanding_service/transports/__init__.py", - "google/cloud/documentai_v1beta2/services/document_understanding_service/transports/base.py", - "google/cloud/documentai_v1beta2/services/document_understanding_service/transports/grpc.py", - "google/cloud/documentai_v1beta2/services/document_understanding_service/transports/grpc_asyncio.py", - "google/cloud/documentai_v1beta2/types/__init__.py", - "google/cloud/documentai_v1beta2/types/document.py", - "google/cloud/documentai_v1beta2/types/document_understanding.py", - "google/cloud/documentai_v1beta2/types/geometry.py", - "google/cloud/documentai_v1beta3/proto/__init__.py", - "google/cloud/documentai_v1beta3/proto/document_pb2.py", - "google/cloud/documentai_v1beta3/proto/document_pb2_grpc.py", - "google/cloud/documentai_v1beta3/proto/document_processor_service_pb2.py", - "google/cloud/documentai_v1beta3/proto/document_processor_service_pb2_grpc.py", - "google/cloud/documentai_v1beta3/proto/geometry_pb2.py", - "google/cloud/documentai_v1beta3/proto/geometry_pb2_grpc.py", - "mypy.ini", - "noxfile.py", - "renovate.json", - "samples/AUTHORING_GUIDE.md", - "samples/CONTRIBUTING.md", - "scripts/decrypt-secrets.sh", - "scripts/fixup_documentai_v1beta2_keywords.py", - "scripts/readme-gen/readme_gen.py", - "scripts/readme-gen/templates/README.tmpl.rst", - "scripts/readme-gen/templates/auth.tmpl.rst", - "scripts/readme-gen/templates/auth_api_key.tmpl.rst", - "scripts/readme-gen/templates/install_deps.tmpl.rst", - "scripts/readme-gen/templates/install_portaudio.tmpl.rst", - "setup.cfg", - "testing/.gitignore", - "tests/unit/gapic/documentai_v1beta2/__init__.py", - "tests/unit/gapic/documentai_v1beta2/test_document_understanding_service.py", - "tests/unit/gapic/v1beta3/test_document_processor_service_client_v1beta3.py" ] } \ No newline at end of file diff --git a/tests/unit/gapic/documentai_v1beta2/test_document_understanding_service.py b/tests/unit/gapic/documentai_v1beta2/test_document_understanding_service.py index 290cb2f2..17fdb324 100644 --- a/tests/unit/gapic/documentai_v1beta2/test_document_understanding_service.py +++ b/tests/unit/gapic/documentai_v1beta2/test_document_understanding_service.py @@ -110,12 +110,12 @@ def test_document_understanding_service_client_from_service_account_file(client_ ) as factory: factory.return_value = creds client = client_class.from_service_account_file("dummy/file/path.json") - assert client._transport._credentials == creds + assert client.transport._credentials == creds client = client_class.from_service_account_json("dummy/file/path.json") - assert client._transport._credentials == creds + assert client.transport._credentials == creds - assert client._transport._host == "us-documentai.googleapis.com:443" + assert client.transport._host == "us-documentai.googleapis.com:443" def test_document_understanding_service_client_get_transport_class(): @@ -493,7 +493,7 @@ def test_batch_process_documents( # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( - type(client._transport.batch_process_documents), "__call__" + type(client.transport.batch_process_documents), "__call__" ) as call: # Designate an appropriate return value for the call. call.return_value = operations_pb2.Operation(name="operations/spam") @@ -515,18 +515,21 @@ def test_batch_process_documents_from_dict(): @pytest.mark.asyncio -async def test_batch_process_documents_async(transport: str = "grpc_asyncio"): +async def test_batch_process_documents_async( + transport: str = "grpc_asyncio", + request_type=document_understanding.BatchProcessDocumentsRequest, +): client = DocumentUnderstandingServiceAsyncClient( credentials=credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = document_understanding.BatchProcessDocumentsRequest() + request = request_type() # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( - type(client._client._transport.batch_process_documents), "__call__" + type(client.transport.batch_process_documents), "__call__" ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( @@ -539,12 +542,17 @@ async def test_batch_process_documents_async(transport: str = "grpc_asyncio"): assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == request + assert args[0] == document_understanding.BatchProcessDocumentsRequest() # Establish that the response is the type that we expect. assert isinstance(response, future.Future) +@pytest.mark.asyncio +async def test_batch_process_documents_async_from_dict(): + await test_batch_process_documents_async(request_type=dict) + + def test_batch_process_documents_field_headers(): client = DocumentUnderstandingServiceClient( credentials=credentials.AnonymousCredentials(), @@ -557,7 +565,7 @@ def test_batch_process_documents_field_headers(): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( - type(client._transport.batch_process_documents), "__call__" + type(client.transport.batch_process_documents), "__call__" ) as call: call.return_value = operations_pb2.Operation(name="operations/op") @@ -586,7 +594,7 @@ async def test_batch_process_documents_field_headers_async(): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( - type(client._client._transport.batch_process_documents), "__call__" + type(client.transport.batch_process_documents), "__call__" ) as call: call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/op") @@ -611,7 +619,7 @@ def test_batch_process_documents_flattened(): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( - type(client._transport.batch_process_documents), "__call__" + type(client.transport.batch_process_documents), "__call__" ) as call: # Designate an appropriate return value for the call. call.return_value = operations_pb2.Operation(name="operations/op") @@ -658,7 +666,7 @@ async def test_batch_process_documents_flattened_async(): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( - type(client._client._transport.batch_process_documents), "__call__" + type(client.transport.batch_process_documents), "__call__" ) as call: # Designate an appropriate return value for the call. call.return_value = operations_pb2.Operation(name="operations/op") @@ -713,9 +721,7 @@ def test_process_document( request = request_type() # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client._transport.process_document), "__call__" - ) as call: + with mock.patch.object(type(client.transport.process_document), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = document.Document( mime_type="mime_type_value", text="text_value", uri="uri_value", @@ -730,6 +736,7 @@ def test_process_document( assert args[0] == document_understanding.ProcessDocumentRequest() # Establish that the response is the type that we expect. + assert isinstance(response, document.Document) assert response.mime_type == "mime_type_value" @@ -742,19 +749,20 @@ def test_process_document_from_dict(): @pytest.mark.asyncio -async def test_process_document_async(transport: str = "grpc_asyncio"): +async def test_process_document_async( + transport: str = "grpc_asyncio", + request_type=document_understanding.ProcessDocumentRequest, +): client = DocumentUnderstandingServiceAsyncClient( credentials=credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = document_understanding.ProcessDocumentRequest() + request = request_type() # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client._client._transport.process_document), "__call__" - ) as call: + with mock.patch.object(type(client.transport.process_document), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( document.Document(mime_type="mime_type_value", text="text_value",) @@ -766,7 +774,7 @@ async def test_process_document_async(transport: str = "grpc_asyncio"): assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == request + assert args[0] == document_understanding.ProcessDocumentRequest() # Establish that the response is the type that we expect. assert isinstance(response, document.Document) @@ -776,6 +784,11 @@ async def test_process_document_async(transport: str = "grpc_asyncio"): assert response.text == "text_value" +@pytest.mark.asyncio +async def test_process_document_async_from_dict(): + await test_process_document_async(request_type=dict) + + def test_process_document_field_headers(): client = DocumentUnderstandingServiceClient( credentials=credentials.AnonymousCredentials(), @@ -787,9 +800,7 @@ def test_process_document_field_headers(): request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client._transport.process_document), "__call__" - ) as call: + with mock.patch.object(type(client.transport.process_document), "__call__") as call: call.return_value = document.Document() client.process_document(request) @@ -816,9 +827,7 @@ async def test_process_document_field_headers_async(): request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client._client._transport.process_document), "__call__" - ) as call: + with mock.patch.object(type(client.transport.process_document), "__call__") as call: call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(document.Document()) await client.process_document(request) @@ -869,7 +878,7 @@ def test_transport_instance(): credentials=credentials.AnonymousCredentials(), ) client = DocumentUnderstandingServiceClient(transport=transport) - assert client._transport is transport + assert client.transport is transport def test_transport_get_channel(): @@ -908,7 +917,7 @@ def test_transport_grpc_default(): credentials=credentials.AnonymousCredentials(), ) assert isinstance( - client._transport, transports.DocumentUnderstandingServiceGrpcTransport, + client.transport, transports.DocumentUnderstandingServiceGrpcTransport, ) @@ -1009,7 +1018,7 @@ def test_document_understanding_service_host_no_port(): api_endpoint="us-documentai.googleapis.com" ), ) - assert client._transport._host == "us-documentai.googleapis.com:443" + assert client.transport._host == "us-documentai.googleapis.com:443" def test_document_understanding_service_host_with_port(): @@ -1019,7 +1028,7 @@ def test_document_understanding_service_host_with_port(): api_endpoint="us-documentai.googleapis.com:8000" ), ) - assert client._transport._host == "us-documentai.googleapis.com:8000" + assert client.transport._host == "us-documentai.googleapis.com:8000" def test_document_understanding_service_grpc_transport_channel(): @@ -1031,6 +1040,7 @@ def test_document_understanding_service_grpc_transport_channel(): ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" + assert transport._ssl_channel_credentials == None def test_document_understanding_service_grpc_asyncio_transport_channel(): @@ -1042,6 +1052,7 @@ def test_document_understanding_service_grpc_asyncio_transport_channel(): ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" + assert transport._ssl_channel_credentials == None @pytest.mark.parametrize( @@ -1089,6 +1100,7 @@ def test_document_understanding_service_transport_channel_mtls_with_client_cert_ quota_project_id=None, ) assert transport.grpc_channel == mock_grpc_channel + assert transport._ssl_channel_credentials == mock_ssl_cred @pytest.mark.parametrize( @@ -1137,7 +1149,7 @@ def test_document_understanding_service_grpc_lro_client(): client = DocumentUnderstandingServiceClient( credentials=credentials.AnonymousCredentials(), transport="grpc", ) - transport = client._transport + transport = client.transport # Ensure that we have a api-core operations client. assert isinstance(transport.operations_client, operations_v1.OperationsClient,) @@ -1150,7 +1162,7 @@ def test_document_understanding_service_grpc_lro_async_client(): client = DocumentUnderstandingServiceAsyncClient( credentials=credentials.AnonymousCredentials(), transport="grpc_asyncio", ) - transport = client._client._transport + transport = client.transport # Ensure that we have a api-core operations client. assert isinstance(transport.operations_client, operations_v1.OperationsAsyncClient,) @@ -1159,6 +1171,109 @@ def test_document_understanding_service_grpc_lro_async_client(): assert transport.operations_client is transport.operations_client +def test_common_billing_account_path(): + billing_account = "squid" + + expected = "billingAccounts/{billing_account}".format( + billing_account=billing_account, + ) + actual = DocumentUnderstandingServiceClient.common_billing_account_path( + billing_account + ) + assert expected == actual + + +def test_parse_common_billing_account_path(): + expected = { + "billing_account": "clam", + } + path = DocumentUnderstandingServiceClient.common_billing_account_path(**expected) + + # Check that the path construction is reversible. + actual = DocumentUnderstandingServiceClient.parse_common_billing_account_path(path) + assert expected == actual + + +def test_common_folder_path(): + folder = "whelk" + + expected = "folders/{folder}".format(folder=folder,) + actual = DocumentUnderstandingServiceClient.common_folder_path(folder) + assert expected == actual + + +def test_parse_common_folder_path(): + expected = { + "folder": "octopus", + } + path = DocumentUnderstandingServiceClient.common_folder_path(**expected) + + # Check that the path construction is reversible. + actual = DocumentUnderstandingServiceClient.parse_common_folder_path(path) + assert expected == actual + + +def test_common_organization_path(): + organization = "oyster" + + expected = "organizations/{organization}".format(organization=organization,) + actual = DocumentUnderstandingServiceClient.common_organization_path(organization) + assert expected == actual + + +def test_parse_common_organization_path(): + expected = { + "organization": "nudibranch", + } + path = DocumentUnderstandingServiceClient.common_organization_path(**expected) + + # Check that the path construction is reversible. + actual = DocumentUnderstandingServiceClient.parse_common_organization_path(path) + assert expected == actual + + +def test_common_project_path(): + project = "cuttlefish" + + expected = "projects/{project}".format(project=project,) + actual = DocumentUnderstandingServiceClient.common_project_path(project) + assert expected == actual + + +def test_parse_common_project_path(): + expected = { + "project": "mussel", + } + path = DocumentUnderstandingServiceClient.common_project_path(**expected) + + # Check that the path construction is reversible. + actual = DocumentUnderstandingServiceClient.parse_common_project_path(path) + assert expected == actual + + +def test_common_location_path(): + project = "winkle" + location = "nautilus" + + expected = "projects/{project}/locations/{location}".format( + project=project, location=location, + ) + actual = DocumentUnderstandingServiceClient.common_location_path(project, location) + assert expected == actual + + +def test_parse_common_location_path(): + expected = { + "project": "scallop", + "location": "abalone", + } + path = DocumentUnderstandingServiceClient.common_location_path(**expected) + + # Check that the path construction is reversible. + actual = DocumentUnderstandingServiceClient.parse_common_location_path(path) + assert expected == actual + + def test_client_withDEFAULT_CLIENT_INFO(): client_info = gapic_v1.client_info.ClientInfo() diff --git a/tests/unit/gapic/documentai_v1beta3/test_document_processor_service.py b/tests/unit/gapic/documentai_v1beta3/test_document_processor_service.py index 4b17a5ed..ad4346e8 100644 --- a/tests/unit/gapic/documentai_v1beta3/test_document_processor_service.py +++ b/tests/unit/gapic/documentai_v1beta3/test_document_processor_service.py @@ -117,12 +117,12 @@ def test_document_processor_service_client_from_service_account_file(client_clas ) as factory: factory.return_value = creds client = client_class.from_service_account_file("dummy/file/path.json") - assert client._transport._credentials == creds + assert client.transport._credentials == creds client = client_class.from_service_account_json("dummy/file/path.json") - assert client._transport._credentials == creds + assert client.transport._credentials == creds - assert client._transport._host == "us-documentai.googleapis.com:443" + assert client.transport._host == "us-documentai.googleapis.com:443" def test_document_processor_service_client_get_transport_class(): @@ -498,9 +498,7 @@ def test_process_document( request = request_type() # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client._transport.process_document), "__call__" - ) as call: + with mock.patch.object(type(client.transport.process_document), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = document_processor_service.ProcessResponse( human_review_operation="human_review_operation_value", @@ -515,6 +513,7 @@ def test_process_document( assert args[0] == document_processor_service.ProcessRequest() # Establish that the response is the type that we expect. + assert isinstance(response, document_processor_service.ProcessResponse) assert response.human_review_operation == "human_review_operation_value" @@ -525,19 +524,20 @@ def test_process_document_from_dict(): @pytest.mark.asyncio -async def test_process_document_async(transport: str = "grpc_asyncio"): +async def test_process_document_async( + transport: str = "grpc_asyncio", + request_type=document_processor_service.ProcessRequest, +): client = DocumentProcessorServiceAsyncClient( credentials=credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = document_processor_service.ProcessRequest() + request = request_type() # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client._client._transport.process_document), "__call__" - ) as call: + with mock.patch.object(type(client.transport.process_document), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( document_processor_service.ProcessResponse( @@ -551,7 +551,7 @@ async def test_process_document_async(transport: str = "grpc_asyncio"): assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == request + assert args[0] == document_processor_service.ProcessRequest() # Establish that the response is the type that we expect. assert isinstance(response, document_processor_service.ProcessResponse) @@ -559,6 +559,11 @@ async def test_process_document_async(transport: str = "grpc_asyncio"): assert response.human_review_operation == "human_review_operation_value" +@pytest.mark.asyncio +async def test_process_document_async_from_dict(): + await test_process_document_async(request_type=dict) + + def test_process_document_field_headers(): client = DocumentProcessorServiceClient( credentials=credentials.AnonymousCredentials(), @@ -570,9 +575,7 @@ def test_process_document_field_headers(): request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client._transport.process_document), "__call__" - ) as call: + with mock.patch.object(type(client.transport.process_document), "__call__") as call: call.return_value = document_processor_service.ProcessResponse() client.process_document(request) @@ -599,9 +602,7 @@ async def test_process_document_field_headers_async(): request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client._client._transport.process_document), "__call__" - ) as call: + with mock.patch.object(type(client.transport.process_document), "__call__") as call: call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( document_processor_service.ProcessResponse() ) @@ -624,9 +625,7 @@ def test_process_document_flattened(): ) # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client._transport.process_document), "__call__" - ) as call: + with mock.patch.object(type(client.transport.process_document), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = document_processor_service.ProcessResponse() @@ -662,9 +661,7 @@ async def test_process_document_flattened_async(): ) # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client._client._transport.process_document), "__call__" - ) as call: + with mock.patch.object(type(client.transport.process_document), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = document_processor_service.ProcessResponse() @@ -710,7 +707,7 @@ def test_batch_process_documents( # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( - type(client._transport.batch_process_documents), "__call__" + type(client.transport.batch_process_documents), "__call__" ) as call: # Designate an appropriate return value for the call. call.return_value = operations_pb2.Operation(name="operations/spam") @@ -732,18 +729,21 @@ def test_batch_process_documents_from_dict(): @pytest.mark.asyncio -async def test_batch_process_documents_async(transport: str = "grpc_asyncio"): +async def test_batch_process_documents_async( + transport: str = "grpc_asyncio", + request_type=document_processor_service.BatchProcessRequest, +): client = DocumentProcessorServiceAsyncClient( credentials=credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = document_processor_service.BatchProcessRequest() + request = request_type() # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( - type(client._client._transport.batch_process_documents), "__call__" + type(client.transport.batch_process_documents), "__call__" ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( @@ -756,12 +756,17 @@ async def test_batch_process_documents_async(transport: str = "grpc_asyncio"): assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == request + assert args[0] == document_processor_service.BatchProcessRequest() # Establish that the response is the type that we expect. assert isinstance(response, future.Future) +@pytest.mark.asyncio +async def test_batch_process_documents_async_from_dict(): + await test_batch_process_documents_async(request_type=dict) + + def test_batch_process_documents_field_headers(): client = DocumentProcessorServiceClient( credentials=credentials.AnonymousCredentials(), @@ -774,7 +779,7 @@ def test_batch_process_documents_field_headers(): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( - type(client._transport.batch_process_documents), "__call__" + type(client.transport.batch_process_documents), "__call__" ) as call: call.return_value = operations_pb2.Operation(name="operations/op") @@ -803,7 +808,7 @@ async def test_batch_process_documents_field_headers_async(): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( - type(client._client._transport.batch_process_documents), "__call__" + type(client.transport.batch_process_documents), "__call__" ) as call: call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/op") @@ -828,7 +833,7 @@ def test_batch_process_documents_flattened(): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( - type(client._transport.batch_process_documents), "__call__" + type(client.transport.batch_process_documents), "__call__" ) as call: # Designate an appropriate return value for the call. call.return_value = operations_pb2.Operation(name="operations/op") @@ -866,7 +871,7 @@ async def test_batch_process_documents_flattened_async(): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( - type(client._client._transport.batch_process_documents), "__call__" + type(client.transport.batch_process_documents), "__call__" ) as call: # Designate an appropriate return value for the call. call.return_value = operations_pb2.Operation(name="operations/op") @@ -913,7 +918,7 @@ def test_review_document( request = request_type() # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object(type(client._transport.review_document), "__call__") as call: + with mock.patch.object(type(client.transport.review_document), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = operations_pb2.Operation(name="operations/spam") @@ -934,19 +939,20 @@ def test_review_document_from_dict(): @pytest.mark.asyncio -async def test_review_document_async(transport: str = "grpc_asyncio"): +async def test_review_document_async( + transport: str = "grpc_asyncio", + request_type=document_processor_service.ReviewDocumentRequest, +): client = DocumentProcessorServiceAsyncClient( credentials=credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = document_processor_service.ReviewDocumentRequest() + request = request_type() # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client._client._transport.review_document), "__call__" - ) as call: + with mock.patch.object(type(client.transport.review_document), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/spam") @@ -958,12 +964,17 @@ async def test_review_document_async(transport: str = "grpc_asyncio"): assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == request + assert args[0] == document_processor_service.ReviewDocumentRequest() # Establish that the response is the type that we expect. assert isinstance(response, future.Future) +@pytest.mark.asyncio +async def test_review_document_async_from_dict(): + await test_review_document_async(request_type=dict) + + def test_review_document_field_headers(): client = DocumentProcessorServiceClient( credentials=credentials.AnonymousCredentials(), @@ -975,7 +986,7 @@ def test_review_document_field_headers(): request.human_review_config = "human_review_config/value" # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object(type(client._transport.review_document), "__call__") as call: + with mock.patch.object(type(client.transport.review_document), "__call__") as call: call.return_value = operations_pb2.Operation(name="operations/op") client.review_document(request) @@ -1005,9 +1016,7 @@ async def test_review_document_field_headers_async(): request.human_review_config = "human_review_config/value" # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client._client._transport.review_document), "__call__" - ) as call: + with mock.patch.object(type(client.transport.review_document), "__call__") as call: call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/op") ) @@ -1033,7 +1042,7 @@ def test_review_document_flattened(): ) # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object(type(client._transport.review_document), "__call__") as call: + with mock.patch.object(type(client.transport.review_document), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = operations_pb2.Operation(name="operations/op") @@ -1070,9 +1079,7 @@ async def test_review_document_flattened_async(): ) # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client._client._transport.review_document), "__call__" - ) as call: + with mock.patch.object(type(client.transport.review_document), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = operations_pb2.Operation(name="operations/op") @@ -1144,7 +1151,7 @@ def test_transport_instance(): credentials=credentials.AnonymousCredentials(), ) client = DocumentProcessorServiceClient(transport=transport) - assert client._transport is transport + assert client.transport is transport def test_transport_get_channel(): @@ -1183,7 +1190,7 @@ def test_transport_grpc_default(): credentials=credentials.AnonymousCredentials(), ) assert isinstance( - client._transport, transports.DocumentProcessorServiceGrpcTransport, + client.transport, transports.DocumentProcessorServiceGrpcTransport, ) @@ -1285,7 +1292,7 @@ def test_document_processor_service_host_no_port(): api_endpoint="us-documentai.googleapis.com" ), ) - assert client._transport._host == "us-documentai.googleapis.com:443" + assert client.transport._host == "us-documentai.googleapis.com:443" def test_document_processor_service_host_with_port(): @@ -1295,7 +1302,7 @@ def test_document_processor_service_host_with_port(): api_endpoint="us-documentai.googleapis.com:8000" ), ) - assert client._transport._host == "us-documentai.googleapis.com:8000" + assert client.transport._host == "us-documentai.googleapis.com:8000" def test_document_processor_service_grpc_transport_channel(): @@ -1307,6 +1314,7 @@ def test_document_processor_service_grpc_transport_channel(): ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" + assert transport._ssl_channel_credentials == None def test_document_processor_service_grpc_asyncio_transport_channel(): @@ -1318,6 +1326,7 @@ def test_document_processor_service_grpc_asyncio_transport_channel(): ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" + assert transport._ssl_channel_credentials == None @pytest.mark.parametrize( @@ -1365,6 +1374,7 @@ def test_document_processor_service_transport_channel_mtls_with_client_cert_sour quota_project_id=None, ) assert transport.grpc_channel == mock_grpc_channel + assert transport._ssl_channel_credentials == mock_ssl_cred @pytest.mark.parametrize( @@ -1411,7 +1421,7 @@ def test_document_processor_service_grpc_lro_client(): client = DocumentProcessorServiceClient( credentials=credentials.AnonymousCredentials(), transport="grpc", ) - transport = client._transport + transport = client.transport # Ensure that we have a api-core operations client. assert isinstance(transport.operations_client, operations_v1.OperationsClient,) @@ -1424,7 +1434,7 @@ def test_document_processor_service_grpc_lro_async_client(): client = DocumentProcessorServiceAsyncClient( credentials=credentials.AnonymousCredentials(), transport="grpc_asyncio", ) - transport = client._client._transport + transport = client.transport # Ensure that we have a api-core operations client. assert isinstance(transport.operations_client, operations_v1.OperationsAsyncClient,) @@ -1433,6 +1443,159 @@ def test_document_processor_service_grpc_lro_async_client(): assert transport.operations_client is transport.operations_client +def test_human_review_config_path(): + project = "squid" + location = "clam" + processor = "whelk" + + expected = "projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig".format( + project=project, location=location, processor=processor, + ) + actual = DocumentProcessorServiceClient.human_review_config_path( + project, location, processor + ) + assert expected == actual + + +def test_parse_human_review_config_path(): + expected = { + "project": "octopus", + "location": "oyster", + "processor": "nudibranch", + } + path = DocumentProcessorServiceClient.human_review_config_path(**expected) + + # Check that the path construction is reversible. + actual = DocumentProcessorServiceClient.parse_human_review_config_path(path) + assert expected == actual + + +def test_processor_path(): + project = "cuttlefish" + location = "mussel" + processor = "winkle" + + expected = "projects/{project}/locations/{location}/processors/{processor}".format( + project=project, location=location, processor=processor, + ) + actual = DocumentProcessorServiceClient.processor_path(project, location, processor) + assert expected == actual + + +def test_parse_processor_path(): + expected = { + "project": "nautilus", + "location": "scallop", + "processor": "abalone", + } + path = DocumentProcessorServiceClient.processor_path(**expected) + + # Check that the path construction is reversible. + actual = DocumentProcessorServiceClient.parse_processor_path(path) + assert expected == actual + + +def test_common_billing_account_path(): + billing_account = "squid" + + expected = "billingAccounts/{billing_account}".format( + billing_account=billing_account, + ) + actual = DocumentProcessorServiceClient.common_billing_account_path(billing_account) + assert expected == actual + + +def test_parse_common_billing_account_path(): + expected = { + "billing_account": "clam", + } + path = DocumentProcessorServiceClient.common_billing_account_path(**expected) + + # Check that the path construction is reversible. + actual = DocumentProcessorServiceClient.parse_common_billing_account_path(path) + assert expected == actual + + +def test_common_folder_path(): + folder = "whelk" + + expected = "folders/{folder}".format(folder=folder,) + actual = DocumentProcessorServiceClient.common_folder_path(folder) + assert expected == actual + + +def test_parse_common_folder_path(): + expected = { + "folder": "octopus", + } + path = DocumentProcessorServiceClient.common_folder_path(**expected) + + # Check that the path construction is reversible. + actual = DocumentProcessorServiceClient.parse_common_folder_path(path) + assert expected == actual + + +def test_common_organization_path(): + organization = "oyster" + + expected = "organizations/{organization}".format(organization=organization,) + actual = DocumentProcessorServiceClient.common_organization_path(organization) + assert expected == actual + + +def test_parse_common_organization_path(): + expected = { + "organization": "nudibranch", + } + path = DocumentProcessorServiceClient.common_organization_path(**expected) + + # Check that the path construction is reversible. + actual = DocumentProcessorServiceClient.parse_common_organization_path(path) + assert expected == actual + + +def test_common_project_path(): + project = "cuttlefish" + + expected = "projects/{project}".format(project=project,) + actual = DocumentProcessorServiceClient.common_project_path(project) + assert expected == actual + + +def test_parse_common_project_path(): + expected = { + "project": "mussel", + } + path = DocumentProcessorServiceClient.common_project_path(**expected) + + # Check that the path construction is reversible. + actual = DocumentProcessorServiceClient.parse_common_project_path(path) + assert expected == actual + + +def test_common_location_path(): + project = "winkle" + location = "nautilus" + + expected = "projects/{project}/locations/{location}".format( + project=project, location=location, + ) + actual = DocumentProcessorServiceClient.common_location_path(project, location) + assert expected == actual + + +def test_parse_common_location_path(): + expected = { + "project": "scallop", + "location": "abalone", + } + path = DocumentProcessorServiceClient.common_location_path(**expected) + + # Check that the path construction is reversible. + actual = DocumentProcessorServiceClient.parse_common_location_path(path) + assert expected == actual + + def test_client_withDEFAULT_CLIENT_INFO(): client_info = gapic_v1.client_info.ClientInfo() From 9032a325159d039f9384daa6e5df09fd6d243880 Mon Sep 17 00:00:00 2001 From: Bu Sun Kim Date: Wed, 18 Nov 2020 00:31:26 +0000 Subject: [PATCH 4/7] chore: delete code from old generator --- docs/gapic/v1beta3/api.rst | 6 - docs/gapic/v1beta3/types.rst | 5 - google/__init__.py | 24 - google/cloud/__init__.py | 24 - google/cloud/documentai/v1beta3.py | 29 - google/cloud/documentai/v1beta3/__init__.py | 47 - .../documentai/v1beta3/gapic/__init__.py | 0 .../document_processor_service_client.py | 488 -- ...ocument_processor_service_client_config.py | 47 - .../cloud/documentai/v1beta3/gapic/enums.py | 157 - .../v1beta3/gapic/transports/__init__.py | 0 ...cument_processor_service_grpc_transport.py | 159 - google/cloud/documentai/v1beta3/types.py | 72 - .../documentai_v1beta3/proto/__init__.py | 0 .../documentai_v1beta3/proto/document_pb2.py | 4756 ----------------- .../proto/document_pb2_grpc.py | 3 - .../proto/document_processor_service_pb2.py | 1290 ----- .../document_processor_service_pb2_grpc.py | 185 - .../documentai_v1beta3/proto/geometry_pb2.py | 270 - .../proto/geometry_pb2_grpc.py | 3 - synth.metadata | 2 +- 21 files changed, 1 insertion(+), 7566 deletions(-) delete mode 100644 docs/gapic/v1beta3/api.rst delete mode 100644 docs/gapic/v1beta3/types.rst delete mode 100644 google/__init__.py delete mode 100644 google/cloud/__init__.py delete mode 100644 google/cloud/documentai/v1beta3.py delete mode 100644 google/cloud/documentai/v1beta3/__init__.py delete mode 100644 google/cloud/documentai/v1beta3/gapic/__init__.py delete mode 100644 google/cloud/documentai/v1beta3/gapic/document_processor_service_client.py delete mode 100644 google/cloud/documentai/v1beta3/gapic/document_processor_service_client_config.py delete mode 100644 google/cloud/documentai/v1beta3/gapic/enums.py delete mode 100644 google/cloud/documentai/v1beta3/gapic/transports/__init__.py delete mode 100644 google/cloud/documentai/v1beta3/gapic/transports/document_processor_service_grpc_transport.py delete mode 100644 google/cloud/documentai/v1beta3/types.py delete mode 100644 google/cloud/documentai_v1beta3/proto/__init__.py delete mode 100644 google/cloud/documentai_v1beta3/proto/document_pb2.py delete mode 100644 google/cloud/documentai_v1beta3/proto/document_pb2_grpc.py delete mode 100644 google/cloud/documentai_v1beta3/proto/document_processor_service_pb2.py delete mode 100644 google/cloud/documentai_v1beta3/proto/document_processor_service_pb2_grpc.py delete mode 100644 google/cloud/documentai_v1beta3/proto/geometry_pb2.py delete mode 100644 google/cloud/documentai_v1beta3/proto/geometry_pb2_grpc.py diff --git a/docs/gapic/v1beta3/api.rst b/docs/gapic/v1beta3/api.rst deleted file mode 100644 index e3af7d64..00000000 --- a/docs/gapic/v1beta3/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Cloud Document AI API -================================ - -.. automodule:: google.cloud.documentai.v1beta3 - :members: - :inherited-members: \ No newline at end of file diff --git a/docs/gapic/v1beta3/types.rst b/docs/gapic/v1beta3/types.rst deleted file mode 100644 index 2bde19f3..00000000 --- a/docs/gapic/v1beta3/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Cloud Document AI API Client -====================================== - -.. automodule:: google.cloud.documentai.v1beta3.types - :members: \ No newline at end of file diff --git a/google/__init__.py b/google/__init__.py deleted file mode 100644 index 9a1b64a6..00000000 --- a/google/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/google/cloud/__init__.py b/google/cloud/__init__.py deleted file mode 100644 index 9a1b64a6..00000000 --- a/google/cloud/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/google/cloud/documentai/v1beta3.py b/google/cloud/documentai/v1beta3.py deleted file mode 100644 index 78fbdb61..00000000 --- a/google/cloud/documentai/v1beta3.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import - -from google.cloud.documentai.v1beta3 import DocumentProcessorServiceClient -from google.cloud.documentai.v1beta3 import enums -from google.cloud.documentai.v1beta3 import types - - -__all__ = ( - "enums", - "types", - "DocumentProcessorServiceClient", -) diff --git a/google/cloud/documentai/v1beta3/__init__.py b/google/cloud/documentai/v1beta3/__init__.py deleted file mode 100644 index 81710100..00000000 --- a/google/cloud/documentai/v1beta3/__init__.py +++ /dev/null @@ -1,47 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys -import warnings - -from google.cloud.documentai.v1beta3 import types -from google.cloud.documentai.v1beta3.gapic import document_processor_service_client -from google.cloud.documentai.v1beta3.gapic import enums - - -if sys.version_info[:2] == (2, 7): - message = ( - "A future version of this library will drop support for Python 2.7. " - "More details about Python 2 support for Google Cloud Client Libraries " - "can be found at https://cloud.google.com/python/docs/python2-sunset/" - ) - warnings.warn(message, DeprecationWarning) - - -class DocumentProcessorServiceClient( - document_processor_service_client.DocumentProcessorServiceClient -): - __doc__ = document_processor_service_client.DocumentProcessorServiceClient.__doc__ - enums = enums - - -__all__ = ( - "enums", - "types", - "DocumentProcessorServiceClient", -) diff --git a/google/cloud/documentai/v1beta3/gapic/__init__.py b/google/cloud/documentai/v1beta3/gapic/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/google/cloud/documentai/v1beta3/gapic/document_processor_service_client.py b/google/cloud/documentai/v1beta3/gapic/document_processor_service_client.py deleted file mode 100644 index dc55ef46..00000000 --- a/google/cloud/documentai/v1beta3/gapic/document_processor_service_client.py +++ /dev/null @@ -1,488 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Accesses the google.cloud.documentai.v1beta3 DocumentProcessorService API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.operation -import google.api_core.operations_v1 -import google.api_core.path_template -import grpc - -from google.cloud.documentai.v1beta3.gapic import ( - document_processor_service_client_config, -) -from google.cloud.documentai.v1beta3.gapic import enums -from google.cloud.documentai.v1beta3.gapic.transports import ( - document_processor_service_grpc_transport, -) -from google.cloud.documentai.v1beta3.proto import document_pb2 -from google.cloud.documentai.v1beta3.proto import document_processor_service_pb2 -from google.cloud.documentai.v1beta3.proto import document_processor_service_pb2_grpc -from google.longrunning import operations_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-documentai", -).version - - -class DocumentProcessorServiceClient(object): - """ - 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. - """ - - SERVICE_ADDRESS = "us-documentai.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.documentai.v1beta3.DocumentProcessorService" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - DocumentProcessorServiceClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def human_review_config_path(cls, project, location, processor): - """Return a fully-qualified human_review_config string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig", - project=project, - location=location, - processor=processor, - ) - - @classmethod - def processor_path(cls, project, location, processor): - """Return a fully-qualified processor string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/processors/{processor}", - project=project, - location=location, - processor=processor, - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.DocumentProcessorServiceGrpcTransport, - Callable[[~.Credentials, type], ~.DocumentProcessorServiceGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = document_processor_service_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=document_processor_service_grpc_transport.DocumentProcessorServiceGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = document_processor_service_grpc_transport.DocumentProcessorServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials, - ) - - if client_info is None: - client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION, - ) - else: - client_info.gapic_version = _GAPIC_LIBRARY_VERSION - self._client_info = client_info - - # Parse out the default settings for retry and timeout for each RPC - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME], - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def process_document( - self, - name, - document=None, - skip_human_review=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Processes a single document. - - Example: - >>> from google.cloud.documentai import v1beta3 - >>> - >>> client = v1beta3.DocumentProcessorServiceClient() - >>> - >>> name = client.processor_path('[PROJECT]', '[LOCATION]', '[PROCESSOR]') - >>> - >>> response = client.process_document(name) - - Args: - name (str): Required. The processor resource name. - document (Union[dict, ~google.cloud.documentai.v1beta3.types.Document]): The document payload, the [content] and [mime_type] fields must be - set. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.documentai.v1beta3.types.Document` - skip_human_review (bool): Whether Human Review feature should be skipped for this request. Default to - false. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.documentai.v1beta3.types.ProcessResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "process_document" not in self._inner_api_calls: - self._inner_api_calls[ - "process_document" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.process_document, - default_retry=self._method_configs["ProcessDocument"].retry, - default_timeout=self._method_configs["ProcessDocument"].timeout, - client_info=self._client_info, - ) - - request = document_processor_service_pb2.ProcessRequest( - name=name, document=document, skip_human_review=skip_human_review, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["process_document"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def batch_process_documents( - self, - name, - input_configs=None, - output_config=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - LRO endpoint to batch process many documents. The output is written - to Cloud Storage as JSON in the [Document] format. - - Example: - >>> from google.cloud.documentai import v1beta3 - >>> - >>> client = v1beta3.DocumentProcessorServiceClient() - >>> - >>> name = client.processor_path('[PROJECT]', '[LOCATION]', '[PROCESSOR]') - >>> - >>> response = client.batch_process_documents(name) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Required. The processor resource name. - input_configs (list[Union[dict, ~google.cloud.documentai.v1beta3.types.BatchInputConfig]]): The input config for each single document in the batch process. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.documentai.v1beta3.types.BatchInputConfig` - output_config (Union[dict, ~google.cloud.documentai.v1beta3.types.BatchOutputConfig]): The overall output config for batch process. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.documentai.v1beta3.types.BatchOutputConfig` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.documentai.v1beta3.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "batch_process_documents" not in self._inner_api_calls: - self._inner_api_calls[ - "batch_process_documents" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.batch_process_documents, - default_retry=self._method_configs["BatchProcessDocuments"].retry, - default_timeout=self._method_configs["BatchProcessDocuments"].timeout, - client_info=self._client_info, - ) - - request = document_processor_service_pb2.BatchProcessRequest( - name=name, input_configs=input_configs, output_config=output_config, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["batch_process_documents"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - document_processor_service_pb2.BatchProcessResponse, - metadata_type=document_processor_service_pb2.BatchProcessMetadata, - ) - - def review_document( - self, - human_review_config, - document=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Send a document for Human Review. The input document should be processed by - the specified processor. - - Example: - >>> from google.cloud.documentai import v1beta3 - >>> - >>> client = v1beta3.DocumentProcessorServiceClient() - >>> - >>> human_review_config = client.human_review_config_path('[PROJECT]', '[LOCATION]', '[PROCESSOR]') - >>> - >>> response = client.review_document(human_review_config) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - human_review_config (str): Required. The resource name of the HumanReviewConfig that the document will be - reviewed with. - document (Union[dict, ~google.cloud.documentai.v1beta3.types.Document]): The document that needs human review. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.documentai.v1beta3.types.Document` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.documentai.v1beta3.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "review_document" not in self._inner_api_calls: - self._inner_api_calls[ - "review_document" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.review_document, - default_retry=self._method_configs["ReviewDocument"].retry, - default_timeout=self._method_configs["ReviewDocument"].timeout, - client_info=self._client_info, - ) - - request = document_processor_service_pb2.ReviewDocumentRequest( - human_review_config=human_review_config, document=document, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("human_review_config", human_review_config)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["review_document"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - document_processor_service_pb2.ReviewDocumentResponse, - metadata_type=document_processor_service_pb2.ReviewDocumentOperationMetadata, - ) diff --git a/google/cloud/documentai/v1beta3/gapic/document_processor_service_client_config.py b/google/cloud/documentai/v1beta3/gapic/document_processor_service_client_config.py deleted file mode 100644 index 9e3dfa47..00000000 --- a/google/cloud/documentai/v1beta3/gapic/document_processor_service_client_config.py +++ /dev/null @@ -1,47 +0,0 @@ -config = { - "interfaces": { - "google.cloud.documentai.v1beta3.DocumentProcessorService": { - "retry_codes": { - "retry_policy_1_codes": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "no_retry_codes": [], - }, - "retry_params": { - "retry_policy_1_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 120000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 120000, - "total_timeout_millis": 120000, - }, - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0, - }, - }, - "methods": { - "ProcessDocument": { - "timeout_millis": 120000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params", - }, - "BatchProcessDocuments": { - "timeout_millis": 120000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params", - }, - "ReviewDocument": { - "timeout_millis": 120000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params", - }, - }, - } - } -} diff --git a/google/cloud/documentai/v1beta3/gapic/enums.py b/google/cloud/documentai/v1beta3/gapic/enums.py deleted file mode 100644 index e93640c5..00000000 --- a/google/cloud/documentai/v1beta3/gapic/enums.py +++ /dev/null @@ -1,157 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class BatchProcessMetadata(object): - class State(enum.IntEnum): - """ - Possible states of the batch processing operation. - - Attributes: - STATE_UNSPECIFIED (int): The default value. This value is used if the state is omitted. - WAITING (int): Request operation is waiting for scheduling. - RUNNING (int): Request is being processed. - SUCCEEDED (int): The batch processing completed successfully. - CANCELLING (int): The batch processing was being cancelled. - CANCELLED (int): The batch processing was cancelled. - FAILED (int): The batch processing has failed. - """ - - STATE_UNSPECIFIED = 0 - WAITING = 1 - RUNNING = 2 - SUCCEEDED = 3 - CANCELLING = 4 - CANCELLED = 5 - FAILED = 6 - - -class Document(object): - class Page(object): - class Layout(object): - class Orientation(enum.IntEnum): - """ - Detected human reading orientation. - - Attributes: - ORIENTATION_UNSPECIFIED (int): Unspecified orientation. - PAGE_UP (int): Orientation is aligned with page up. - PAGE_RIGHT (int): Orientation is aligned with page right. - Turn the head 90 degrees clockwise from upright to read. - PAGE_DOWN (int): Orientation is aligned with page down. - Turn the head 180 degrees from upright to read. - PAGE_LEFT (int): Orientation is aligned with page left. - Turn the head 90 degrees counterclockwise from upright to read. - """ - - ORIENTATION_UNSPECIFIED = 0 - PAGE_UP = 1 - PAGE_RIGHT = 2 - PAGE_DOWN = 3 - PAGE_LEFT = 4 - - class Token(object): - class DetectedBreak(object): - class Type(enum.IntEnum): - """ - Enum to denote the type of break found. - - Attributes: - TYPE_UNSPECIFIED (int): Unspecified break type. - SPACE (int): A single whitespace. - WIDE_SPACE (int): A wider whitespace. - HYPHEN (int): A hyphen that indicates that a token has been split across lines. - """ - - TYPE_UNSPECIFIED = 0 - SPACE = 1 - WIDE_SPACE = 2 - HYPHEN = 3 - - class PageAnchor(object): - class PageRef(object): - class LayoutType(enum.IntEnum): - """ - The type of layout that is being referenced. - - Attributes: - LAYOUT_TYPE_UNSPECIFIED (int): Layout Unspecified. - BLOCK (int): References a ``Page.blocks`` element. - PARAGRAPH (int): References a ``Page.paragraphs`` element. - LINE (int): References a ``Page.lines`` element. - TOKEN (int): References a ``Page.tokens`` element. - VISUAL_ELEMENT (int): References a ``Page.visual_elements`` element. - TABLE (int): Refrrences a ``Page.tables`` element. - FORM_FIELD (int): References a ``Page.form_fields`` element. - """ - - LAYOUT_TYPE_UNSPECIFIED = 0 - BLOCK = 1 - PARAGRAPH = 2 - LINE = 3 - TOKEN = 4 - VISUAL_ELEMENT = 5 - TABLE = 6 - FORM_FIELD = 7 - - class Provenance(object): - class OperationType(enum.IntEnum): - """ - If a processor or agent does an explicit operation on existing elements. - - Attributes: - OPERATION_TYPE_UNSPECIFIED (int): Operation type unspecified. - ADD (int): Add an element. Implicit if no ``parents`` are set for the - provenance. - REMOVE (int): The element is removed. No ``parents`` should be set. - REPLACE (int): Explicitly replaces the element(s) identified by ``parents``. - EVAL_REQUESTED (int): Element is requested for human review. - EVAL_APPROVED (int): Element is review and approved at human review, confidence will be set - to 1.0 - """ - - OPERATION_TYPE_UNSPECIFIED = 0 - ADD = 1 - REMOVE = 2 - REPLACE = 3 - EVAL_REQUESTED = 4 - EVAL_APPROVED = 5 - - -class ReviewDocumentOperationMetadata(object): - class State(enum.IntEnum): - """ - State of the longrunning operation. - - Attributes: - STATE_UNSPECIFIED (int): Unspecified state. - RUNNING (int): Operation is still running. - CANCELLING (int): Operation is being cancelled. - SUCCEEDED (int): Operation succeeded. - FAILED (int): Operation failed. - CANCELLED (int): Operation is cancelled. - """ - - STATE_UNSPECIFIED = 0 - RUNNING = 1 - CANCELLING = 2 - SUCCEEDED = 3 - FAILED = 4 - CANCELLED = 5 diff --git a/google/cloud/documentai/v1beta3/gapic/transports/__init__.py b/google/cloud/documentai/v1beta3/gapic/transports/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/google/cloud/documentai/v1beta3/gapic/transports/document_processor_service_grpc_transport.py b/google/cloud/documentai/v1beta3/gapic/transports/document_processor_service_grpc_transport.py deleted file mode 100644 index 0d5aac7a..00000000 --- a/google/cloud/documentai/v1beta3/gapic/transports/document_processor_service_grpc_transport.py +++ /dev/null @@ -1,159 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import google.api_core.grpc_helpers -import google.api_core.operations_v1 - -from google.cloud.documentai.v1beta3.proto import document_processor_service_pb2_grpc - - -class DocumentProcessorServiceGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.documentai.v1beta3 DocumentProcessorService API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, channel=None, credentials=None, address="us-documentai.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive.", - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "document_processor_service_stub": document_processor_service_pb2_grpc.DocumentProcessorServiceStub( - channel - ), - } - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="us-documentai.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def process_document(self): - """Return the gRPC stub for :meth:`DocumentProcessorServiceClient.process_document`. - - Processes a single document. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["document_processor_service_stub"].ProcessDocument - - @property - def batch_process_documents(self): - """Return the gRPC stub for :meth:`DocumentProcessorServiceClient.batch_process_documents`. - - LRO endpoint to batch process many documents. The output is written - to Cloud Storage as JSON in the [Document] format. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["document_processor_service_stub"].BatchProcessDocuments - - @property - def review_document(self): - """Return the gRPC stub for :meth:`DocumentProcessorServiceClient.review_document`. - - Send a document for Human Review. The input document should be processed by - the specified processor. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["document_processor_service_stub"].ReviewDocument diff --git a/google/cloud/documentai/v1beta3/types.py b/google/cloud/documentai/v1beta3/types.py deleted file mode 100644 index 85063d97..00000000 --- a/google/cloud/documentai/v1beta3/types.py +++ /dev/null @@ -1,72 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.documentai.v1beta3.proto import document_pb2 -from google.cloud.documentai.v1beta3.proto import document_processor_service_pb2 -from google.cloud.documentai.v1beta3.proto import geometry_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import any_pb2 -from google.protobuf import duration_pb2 -from google.protobuf import timestamp_pb2 -from google.protobuf import wrappers_pb2 -from google.rpc import status_pb2 -from google.type import color_pb2 -from google.type import date_pb2 -from google.type import datetime_pb2 -from google.type import money_pb2 -from google.type import postal_address_pb2 - - -_shared_modules = [ - operations_pb2, - any_pb2, - duration_pb2, - timestamp_pb2, - wrappers_pb2, - status_pb2, - color_pb2, - date_pb2, - datetime_pb2, - money_pb2, - postal_address_pb2, -] - -_local_modules = [ - document_pb2, - document_processor_service_pb2, - geometry_pb2, -] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.documentai.v1beta3.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/google/cloud/documentai_v1beta3/proto/__init__.py b/google/cloud/documentai_v1beta3/proto/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/google/cloud/documentai_v1beta3/proto/document_pb2.py b/google/cloud/documentai_v1beta3/proto/document_pb2.py deleted file mode 100644 index f6156276..00000000 --- a/google/cloud/documentai_v1beta3/proto/document_pb2.py +++ /dev/null @@ -1,4756 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai_v1beta3/proto/document.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.cloud.documentai_v1beta3.proto import ( - geometry_pb2 as google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_geometry__pb2, -) -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 -from google.type import color_pb2 as google_dot_type_dot_color__pb2 -from google.type import date_pb2 as google_dot_type_dot_date__pb2 -from google.type import datetime_pb2 as google_dot_type_dot_datetime__pb2 -from google.type import money_pb2 as google_dot_type_dot_money__pb2 -from google.type import postal_address_pb2 as google_dot_type_dot_postal__address__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/documentai_v1beta3/proto/document.proto", - package="google.cloud.documentai.v1beta3", - syntax="proto3", - serialized_options=b"\n#com.google.cloud.documentai.v1beta3B\rDocumentProtoP\001ZIgoogle.golang.org/genproto/googleapis/cloud/documentai/v1beta3;documentai\252\002\037Google.Cloud.DocumentAI.v1beta3\312\002\037Google\\Cloud\\DocumentAi\\v1beta3\352\002!Google::Cloud::DocumentAI::master", - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n4google/cloud/documentai_v1beta3/proto/document.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x34google/cloud/documentai_v1beta3/proto/geometry.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17google/type/color.proto\x1a\x16google/type/date.proto\x1a\x1agoogle/type/datetime.proto\x1a\x17google/type/money.proto\x1a google/type/postal_address.proto\x1a\x1cgoogle/api/annotations.proto"\xa5<\n\x08\x44ocument\x12\r\n\x03uri\x18\x01 \x01(\tH\x00\x12\x11\n\x07\x63ontent\x18\x02 \x01(\x0cH\x00\x12\x11\n\tmime_type\x18\x03 \x01(\t\x12\x0c\n\x04text\x18\x04 \x01(\t\x12\x44\n\x0btext_styles\x18\x05 \x03(\x0b\x32/.google.cloud.documentai.v1beta3.Document.Style\x12=\n\x05pages\x18\x06 \x03(\x0b\x32..google.cloud.documentai.v1beta3.Document.Page\x12\x42\n\x08\x65ntities\x18\x07 \x03(\x0b\x32\x30.google.cloud.documentai.v1beta3.Document.Entity\x12R\n\x10\x65ntity_relations\x18\x08 \x03(\x0b\x32\x38.google.cloud.documentai.v1beta3.Document.EntityRelation\x12K\n\x0ctranslations\x18\x0c \x03(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Translation\x12J\n\x0ctext_changes\x18\x0e \x03(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.TextChange\x12G\n\nshard_info\x18\t \x01(\x0b\x32\x33.google.cloud.documentai.v1beta3.Document.ShardInfo\x12!\n\x05\x65rror\x18\n \x01(\x0b\x32\x12.google.rpc.Status\x12\x45\n\trevisions\x18\r \x03(\x0b\x32\x32.google.cloud.documentai.v1beta3.Document.Revision\x1aJ\n\tShardInfo\x12\x13\n\x0bshard_index\x18\x01 \x01(\x03\x12\x13\n\x0bshard_count\x18\x02 \x01(\x03\x12\x13\n\x0btext_offset\x18\x03 \x01(\x03\x1a\xda\x02\n\x05Style\x12I\n\x0btext_anchor\x18\x01 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.TextAnchor\x12!\n\x05\x63olor\x18\x02 \x01(\x0b\x32\x12.google.type.Color\x12,\n\x10\x62\x61\x63kground_color\x18\x03 \x01(\x0b\x32\x12.google.type.Color\x12\x13\n\x0b\x66ont_weight\x18\x04 \x01(\t\x12\x12\n\ntext_style\x18\x05 \x01(\t\x12\x17\n\x0ftext_decoration\x18\x06 \x01(\t\x12K\n\tfont_size\x18\x07 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.Document.Style.FontSize\x1a&\n\x08\x46ontSize\x12\x0c\n\x04size\x18\x01 \x01(\x02\x12\x0c\n\x04unit\x18\x02 \x01(\t\x1a\xd0\x1f\n\x04Page\x12\x13\n\x0bpage_number\x18\x01 \x01(\x05\x12\x43\n\x05image\x18\r \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Page.Image\x12I\n\ntransforms\x18\x0e \x03(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Matrix\x12K\n\tdimension\x18\x02 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta3.Document.Page.Dimension\x12\x45\n\x06layout\x18\x03 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12[\n\x12\x64\x65tected_languages\x18\x04 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12\x44\n\x06\x62locks\x18\x05 \x03(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Page.Block\x12L\n\nparagraphs\x18\x06 \x03(\x0b\x32\x38.google.cloud.documentai.v1beta3.Document.Page.Paragraph\x12\x42\n\x05lines\x18\x07 \x03(\x0b\x32\x33.google.cloud.documentai.v1beta3.Document.Page.Line\x12\x44\n\x06tokens\x18\x08 \x03(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Page.Token\x12U\n\x0fvisual_elements\x18\t \x03(\x0b\x32<.google.cloud.documentai.v1beta3.Document.Page.VisualElement\x12\x44\n\x06tables\x18\n \x03(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Page.Table\x12M\n\x0b\x66orm_fields\x18\x0b \x03(\x0b\x32\x38.google.cloud.documentai.v1beta3.Document.Page.FormField\x1a\x38\n\tDimension\x12\r\n\x05width\x18\x01 \x01(\x02\x12\x0e\n\x06height\x18\x02 \x01(\x02\x12\x0c\n\x04unit\x18\x03 \x01(\t\x1aJ\n\x05Image\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\x0c\x12\x11\n\tmime_type\x18\x02 \x01(\t\x12\r\n\x05width\x18\x03 \x01(\x05\x12\x0e\n\x06height\x18\x04 \x01(\x05\x1a@\n\x06Matrix\x12\x0c\n\x04rows\x18\x01 \x01(\x05\x12\x0c\n\x04\x63ols\x18\x02 \x01(\x05\x12\x0c\n\x04type\x18\x03 \x01(\x05\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\x0c\x1a\xec\x02\n\x06Layout\x12I\n\x0btext_anchor\x18\x01 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.TextAnchor\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x44\n\rbounding_poly\x18\x03 \x01(\x0b\x32-.google.cloud.documentai.v1beta3.BoundingPoly\x12V\n\x0borientation\x18\x04 \x01(\x0e\x32\x41.google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation"e\n\x0bOrientation\x12\x1b\n\x17ORIENTATION_UNSPECIFIED\x10\x00\x12\x0b\n\x07PAGE_UP\x10\x01\x12\x0e\n\nPAGE_RIGHT\x10\x02\x12\r\n\tPAGE_DOWN\x10\x03\x12\r\n\tPAGE_LEFT\x10\x04\x1a\xf5\x01\n\x05\x42lock\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12[\n\x12\x64\x65tected_languages\x18\x02 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12H\n\nprovenance\x18\x03 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Provenance\x1a\xf9\x01\n\tParagraph\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12[\n\x12\x64\x65tected_languages\x18\x02 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12H\n\nprovenance\x18\x03 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Provenance\x1a\xf4\x01\n\x04Line\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12[\n\x12\x64\x65tected_languages\x18\x02 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12H\n\nprovenance\x18\x03 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Provenance\x1a\xff\x03\n\x05Token\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12Z\n\x0e\x64\x65tected_break\x18\x02 \x01(\x0b\x32\x42.google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak\x12[\n\x12\x64\x65tected_languages\x18\x03 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12H\n\nprovenance\x18\x04 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Provenance\x1a\xab\x01\n\rDetectedBreak\x12U\n\x04type\x18\x01 \x01(\x0e\x32G.google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type"C\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05SPACE\x10\x01\x12\x0e\n\nWIDE_SPACE\x10\x02\x12\n\n\x06HYPHEN\x10\x03\x1a\xc1\x01\n\rVisualElement\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12\x0c\n\x04type\x18\x02 \x01(\t\x12[\n\x12\x64\x65tected_languages\x18\x03 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x1a\x82\x05\n\x05Table\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12R\n\x0bheader_rows\x18\x02 \x03(\x0b\x32=.google.cloud.documentai.v1beta3.Document.Page.Table.TableRow\x12P\n\tbody_rows\x18\x03 \x03(\x0b\x32=.google.cloud.documentai.v1beta3.Document.Page.Table.TableRow\x12[\n\x12\x64\x65tected_languages\x18\x04 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x1aY\n\x08TableRow\x12M\n\x05\x63\x65lls\x18\x01 \x03(\x0b\x32>.google.cloud.documentai.v1beta3.Document.Page.Table.TableCell\x1a\xd3\x01\n\tTableCell\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12\x10\n\x08row_span\x18\x02 \x01(\x05\x12\x10\n\x08\x63ol_span\x18\x03 \x01(\x05\x12[\n\x12\x64\x65tected_languages\x18\x04 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x1a\xfb\x02\n\tFormField\x12I\n\nfield_name\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12J\n\x0b\x66ield_value\x18\x02 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta3.Document.Page.Layout\x12`\n\x17name_detected_languages\x18\x03 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12\x61\n\x18value_detected_languages\x18\x04 \x03(\x0b\x32?.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage\x12\x12\n\nvalue_type\x18\x05 \x01(\t\x1a=\n\x10\x44\x65tectedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x1a\x87\x06\n\x06\x45ntity\x12I\n\x0btext_anchor\x18\x01 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.TextAnchor\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x14\n\x0cmention_text\x18\x03 \x01(\t\x12\x12\n\nmention_id\x18\x04 \x01(\t\x12\x17\n\nconfidence\x18\x05 \x01(\x02\x42\x03\xe0\x41\x01\x12N\n\x0bpage_anchor\x18\x06 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.PageAnchorB\x03\xe0\x41\x01\x12\n\n\x02id\x18\x07 \x01(\t\x12_\n\x10normalized_value\x18\t \x01(\x0b\x32@.google.cloud.documentai.v1beta3.Document.Entity.NormalizedValueB\x03\xe0\x41\x01\x12I\n\nproperties\x18\n \x03(\x0b\x32\x30.google.cloud.documentai.v1beta3.Document.EntityB\x03\xe0\x41\x01\x12M\n\nprovenance\x18\x0b \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.ProvenanceB\x03\xe0\x41\x01\x12\x15\n\x08redacted\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x1a\xf2\x01\n\x0fNormalizedValue\x12)\n\x0bmoney_value\x18\x02 \x01(\x0b\x32\x12.google.type.MoneyH\x00\x12\'\n\ndate_value\x18\x03 \x01(\x0b\x32\x11.google.type.DateH\x00\x12/\n\x0e\x64\x61tetime_value\x18\x04 \x01(\x0b\x32\x15.google.type.DateTimeH\x00\x12\x33\n\raddress_value\x18\x05 \x01(\x0b\x32\x1a.google.type.PostalAddressH\x00\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x02\x42\x12\n\x10structured_value\x1aI\n\x0e\x45ntityRelation\x12\x12\n\nsubject_id\x18\x01 \x01(\t\x12\x11\n\tobject_id\x18\x02 \x01(\t\x12\x10\n\x08relation\x18\x03 \x01(\t\x1a\xd2\x01\n\x0bTranslation\x12I\n\x0btext_anchor\x18\x01 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.TextAnchor\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x17\n\x0ftranslated_text\x18\x03 \x01(\t\x12H\n\nprovenance\x18\x04 \x03(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.Provenance\x1a\xad\x01\n\nTextAnchor\x12W\n\rtext_segments\x18\x01 \x03(\x0b\x32@.google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\x1a\x35\n\x0bTextSegment\x12\x13\n\x0bstart_index\x18\x01 \x01(\x03\x12\x11\n\tend_index\x18\x02 \x01(\x03\x1a\xce\x03\n\nPageAnchor\x12O\n\tpage_refs\x18\x01 \x03(\x0b\x32<.google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef\x1a\xee\x02\n\x07PageRef\x12\x11\n\x04page\x18\x01 \x01(\x03\x42\x03\xe0\x41\x02\x12\x61\n\x0blayout_type\x18\x02 \x01(\x0e\x32G.google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutTypeB\x03\xe0\x41\x01\x12\x18\n\tlayout_id\x18\x03 \x01(\tB\x05\x18\x01\xe0\x41\x01\x12I\n\rbounding_poly\x18\x04 \x01(\x0b\x32-.google.cloud.documentai.v1beta3.BoundingPolyB\x03\xe0\x41\x01"\x87\x01\n\nLayoutType\x12\x1b\n\x17LAYOUT_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x42LOCK\x10\x01\x12\r\n\tPARAGRAPH\x10\x02\x12\x08\n\x04LINE\x10\x03\x12\t\n\x05TOKEN\x10\x04\x12\x12\n\x0eVISUAL_ELEMENT\x10\x05\x12\t\n\x05TABLE\x10\x06\x12\x0e\n\nFORM_FIELD\x10\x07\x1a\xec\x02\n\nProvenance\x12\x10\n\x08revision\x18\x01 \x01(\x05\x12\n\n\x02id\x18\x02 \x01(\x05\x12L\n\x07parents\x18\x03 \x03(\x0b\x32;.google.cloud.documentai.v1beta3.Document.Provenance.Parent\x12P\n\x04type\x18\x04 \x01(\x0e\x32\x42.google.cloud.documentai.v1beta3.Document.Provenance.OperationType\x1a&\n\x06Parent\x12\x10\n\x08revision\x18\x01 \x01(\x05\x12\n\n\x02id\x18\x02 \x01(\x05"x\n\rOperationType\x12\x1e\n\x1aOPERATION_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02\x12\x0b\n\x07REPLACE\x10\x03\x12\x12\n\x0e\x45VAL_REQUESTED\x10\x04\x12\x11\n\rEVAL_APPROVED\x10\x05\x1a\x92\x02\n\x08Revision\x12\x0f\n\x05\x61gent\x18\x04 \x01(\tH\x00\x12\x13\n\tprocessor\x18\x05 \x01(\tH\x00\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06parent\x18\x02 \x03(\x05\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12T\n\x0chuman_review\x18\x06 \x01(\x0b\x32>.google.cloud.documentai.v1beta3.Document.Revision.HumanReview\x1a\x33\n\x0bHumanReview\x12\r\n\x05state\x18\x01 \x01(\t\x12\x15\n\rstate_message\x18\x02 \x01(\tB\x08\n\x06source\x1a\xb7\x01\n\nTextChange\x12I\n\x0btext_anchor\x18\x01 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.TextAnchor\x12\x14\n\x0c\x63hanged_text\x18\x02 \x01(\t\x12H\n\nprovenance\x18\x03 \x03(\x0b\x32\x34.google.cloud.documentai.v1beta3.Document.ProvenanceB\x08\n\x06sourceB\xe9\x01\n#com.google.cloud.documentai.v1beta3B\rDocumentProtoP\x01ZIgoogle.golang.org/genproto/googleapis/cloud/documentai/v1beta3;documentai\xaa\x02\x1fGoogle.Cloud.DocumentAI.v1beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAi\\v1beta3\xea\x02!Google::Cloud::DocumentAI::masterb\x06proto3', - dependencies=[ - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_geometry__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_rpc_dot_status__pb2.DESCRIPTOR, - google_dot_type_dot_color__pb2.DESCRIPTOR, - google_dot_type_dot_date__pb2.DESCRIPTOR, - google_dot_type_dot_datetime__pb2.DESCRIPTOR, - google_dot_type_dot_money__pb2.DESCRIPTOR, - google_dot_type_dot_postal__address__pb2.DESCRIPTOR, - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - ], -) - - -_DOCUMENT_PAGE_LAYOUT_ORIENTATION = _descriptor.EnumDescriptor( - name="Orientation", - full_name="google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="ORIENTATION_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="PAGE_UP", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="PAGE_RIGHT", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="PAGE_DOWN", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="PAGE_LEFT", - index=4, - number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2923, - serialized_end=3024, -) -_sym_db.RegisterEnumDescriptor(_DOCUMENT_PAGE_LAYOUT_ORIENTATION) - -_DOCUMENT_PAGE_TOKEN_DETECTEDBREAK_TYPE = _descriptor.EnumDescriptor( - name="Type", - full_name="google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="SPACE", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="WIDE_SPACE", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="HYPHEN", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=4218, - serialized_end=4285, -) -_sym_db.RegisterEnumDescriptor(_DOCUMENT_PAGE_TOKEN_DETECTEDBREAK_TYPE) - -_DOCUMENT_PAGEANCHOR_PAGEREF_LAYOUTTYPE = _descriptor.EnumDescriptor( - name="LayoutType", - full_name="google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="LAYOUT_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="BLOCK", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="PARAGRAPH", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="LINE", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="TOKEN", - index=4, - number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="VISUAL_ELEMENT", - index=5, - number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="TABLE", - index=6, - number=6, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FORM_FIELD", - index=7, - number=7, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=7143, - serialized_end=7278, -) -_sym_db.RegisterEnumDescriptor(_DOCUMENT_PAGEANCHOR_PAGEREF_LAYOUTTYPE) - -_DOCUMENT_PROVENANCE_OPERATIONTYPE = _descriptor.EnumDescriptor( - name="OperationType", - full_name="google.cloud.documentai.v1beta3.Document.Provenance.OperationType", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="OPERATION_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="ADD", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="REMOVE", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="REPLACE", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="EVAL_REQUESTED", - index=4, - number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="EVAL_APPROVED", - index=5, - number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=7525, - serialized_end=7645, -) -_sym_db.RegisterEnumDescriptor(_DOCUMENT_PROVENANCE_OPERATIONTYPE) - - -_DOCUMENT_SHARDINFO = _descriptor.Descriptor( - name="ShardInfo", - full_name="google.cloud.documentai.v1beta3.Document.ShardInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="shard_index", - full_name="google.cloud.documentai.v1beta3.Document.ShardInfo.shard_index", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="shard_count", - full_name="google.cloud.documentai.v1beta3.Document.ShardInfo.shard_count", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="text_offset", - full_name="google.cloud.documentai.v1beta3.Document.ShardInfo.text_offset", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1097, - serialized_end=1171, -) - -_DOCUMENT_STYLE_FONTSIZE = _descriptor.Descriptor( - name="FontSize", - full_name="google.cloud.documentai.v1beta3.Document.Style.FontSize", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="size", - full_name="google.cloud.documentai.v1beta3.Document.Style.FontSize.size", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="unit", - full_name="google.cloud.documentai.v1beta3.Document.Style.FontSize.unit", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1482, - serialized_end=1520, -) - -_DOCUMENT_STYLE = _descriptor.Descriptor( - name="Style", - full_name="google.cloud.documentai.v1beta3.Document.Style", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="text_anchor", - full_name="google.cloud.documentai.v1beta3.Document.Style.text_anchor", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="color", - full_name="google.cloud.documentai.v1beta3.Document.Style.color", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="background_color", - full_name="google.cloud.documentai.v1beta3.Document.Style.background_color", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="font_weight", - full_name="google.cloud.documentai.v1beta3.Document.Style.font_weight", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="text_style", - full_name="google.cloud.documentai.v1beta3.Document.Style.text_style", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="text_decoration", - full_name="google.cloud.documentai.v1beta3.Document.Style.text_decoration", - index=5, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="font_size", - full_name="google.cloud.documentai.v1beta3.Document.Style.font_size", - index=6, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_DOCUMENT_STYLE_FONTSIZE,], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1174, - serialized_end=1520, -) - -_DOCUMENT_PAGE_DIMENSION = _descriptor.Descriptor( - name="Dimension", - full_name="google.cloud.documentai.v1beta3.Document.Page.Dimension", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="width", - full_name="google.cloud.documentai.v1beta3.Document.Page.Dimension.width", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="height", - full_name="google.cloud.documentai.v1beta3.Document.Page.Dimension.height", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="unit", - full_name="google.cloud.documentai.v1beta3.Document.Page.Dimension.unit", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2459, - serialized_end=2515, -) - -_DOCUMENT_PAGE_IMAGE = _descriptor.Descriptor( - name="Image", - full_name="google.cloud.documentai.v1beta3.Document.Page.Image", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="content", - full_name="google.cloud.documentai.v1beta3.Document.Page.Image.content", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="mime_type", - full_name="google.cloud.documentai.v1beta3.Document.Page.Image.mime_type", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="width", - full_name="google.cloud.documentai.v1beta3.Document.Page.Image.width", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="height", - full_name="google.cloud.documentai.v1beta3.Document.Page.Image.height", - index=3, - number=4, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2517, - serialized_end=2591, -) - -_DOCUMENT_PAGE_MATRIX = _descriptor.Descriptor( - name="Matrix", - full_name="google.cloud.documentai.v1beta3.Document.Page.Matrix", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="rows", - full_name="google.cloud.documentai.v1beta3.Document.Page.Matrix.rows", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="cols", - full_name="google.cloud.documentai.v1beta3.Document.Page.Matrix.cols", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.documentai.v1beta3.Document.Page.Matrix.type", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="data", - full_name="google.cloud.documentai.v1beta3.Document.Page.Matrix.data", - index=3, - number=4, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2593, - serialized_end=2657, -) - -_DOCUMENT_PAGE_LAYOUT = _descriptor.Descriptor( - name="Layout", - full_name="google.cloud.documentai.v1beta3.Document.Page.Layout", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="text_anchor", - full_name="google.cloud.documentai.v1beta3.Document.Page.Layout.text_anchor", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.documentai.v1beta3.Document.Page.Layout.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="bounding_poly", - full_name="google.cloud.documentai.v1beta3.Document.Page.Layout.bounding_poly", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="orientation", - full_name="google.cloud.documentai.v1beta3.Document.Page.Layout.orientation", - index=3, - number=4, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_DOCUMENT_PAGE_LAYOUT_ORIENTATION,], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2660, - serialized_end=3024, -) - -_DOCUMENT_PAGE_BLOCK = _descriptor.Descriptor( - name="Block", - full_name="google.cloud.documentai.v1beta3.Document.Page.Block", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="layout", - full_name="google.cloud.documentai.v1beta3.Document.Page.Block.layout", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="detected_languages", - full_name="google.cloud.documentai.v1beta3.Document.Page.Block.detected_languages", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="provenance", - full_name="google.cloud.documentai.v1beta3.Document.Page.Block.provenance", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3027, - serialized_end=3272, -) - -_DOCUMENT_PAGE_PARAGRAPH = _descriptor.Descriptor( - name="Paragraph", - full_name="google.cloud.documentai.v1beta3.Document.Page.Paragraph", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="layout", - full_name="google.cloud.documentai.v1beta3.Document.Page.Paragraph.layout", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="detected_languages", - full_name="google.cloud.documentai.v1beta3.Document.Page.Paragraph.detected_languages", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="provenance", - full_name="google.cloud.documentai.v1beta3.Document.Page.Paragraph.provenance", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3275, - serialized_end=3524, -) - -_DOCUMENT_PAGE_LINE = _descriptor.Descriptor( - name="Line", - full_name="google.cloud.documentai.v1beta3.Document.Page.Line", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="layout", - full_name="google.cloud.documentai.v1beta3.Document.Page.Line.layout", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="detected_languages", - full_name="google.cloud.documentai.v1beta3.Document.Page.Line.detected_languages", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="provenance", - full_name="google.cloud.documentai.v1beta3.Document.Page.Line.provenance", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3527, - serialized_end=3771, -) - -_DOCUMENT_PAGE_TOKEN_DETECTEDBREAK = _descriptor.Descriptor( - name="DetectedBreak", - full_name="google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_DOCUMENT_PAGE_TOKEN_DETECTEDBREAK_TYPE,], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4114, - serialized_end=4285, -) - -_DOCUMENT_PAGE_TOKEN = _descriptor.Descriptor( - name="Token", - full_name="google.cloud.documentai.v1beta3.Document.Page.Token", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="layout", - full_name="google.cloud.documentai.v1beta3.Document.Page.Token.layout", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="detected_break", - full_name="google.cloud.documentai.v1beta3.Document.Page.Token.detected_break", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="detected_languages", - full_name="google.cloud.documentai.v1beta3.Document.Page.Token.detected_languages", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="provenance", - full_name="google.cloud.documentai.v1beta3.Document.Page.Token.provenance", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_DOCUMENT_PAGE_TOKEN_DETECTEDBREAK,], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3774, - serialized_end=4285, -) - -_DOCUMENT_PAGE_VISUALELEMENT = _descriptor.Descriptor( - name="VisualElement", - full_name="google.cloud.documentai.v1beta3.Document.Page.VisualElement", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="layout", - full_name="google.cloud.documentai.v1beta3.Document.Page.VisualElement.layout", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.documentai.v1beta3.Document.Page.VisualElement.type", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="detected_languages", - full_name="google.cloud.documentai.v1beta3.Document.Page.VisualElement.detected_languages", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4288, - serialized_end=4481, -) - -_DOCUMENT_PAGE_TABLE_TABLEROW = _descriptor.Descriptor( - name="TableRow", - full_name="google.cloud.documentai.v1beta3.Document.Page.Table.TableRow", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="cells", - full_name="google.cloud.documentai.v1beta3.Document.Page.Table.TableRow.cells", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4823, - serialized_end=4912, -) - -_DOCUMENT_PAGE_TABLE_TABLECELL = _descriptor.Descriptor( - name="TableCell", - full_name="google.cloud.documentai.v1beta3.Document.Page.Table.TableCell", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="layout", - full_name="google.cloud.documentai.v1beta3.Document.Page.Table.TableCell.layout", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="row_span", - full_name="google.cloud.documentai.v1beta3.Document.Page.Table.TableCell.row_span", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="col_span", - full_name="google.cloud.documentai.v1beta3.Document.Page.Table.TableCell.col_span", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="detected_languages", - full_name="google.cloud.documentai.v1beta3.Document.Page.Table.TableCell.detected_languages", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4915, - serialized_end=5126, -) - -_DOCUMENT_PAGE_TABLE = _descriptor.Descriptor( - name="Table", - full_name="google.cloud.documentai.v1beta3.Document.Page.Table", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="layout", - full_name="google.cloud.documentai.v1beta3.Document.Page.Table.layout", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="header_rows", - full_name="google.cloud.documentai.v1beta3.Document.Page.Table.header_rows", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="body_rows", - full_name="google.cloud.documentai.v1beta3.Document.Page.Table.body_rows", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="detected_languages", - full_name="google.cloud.documentai.v1beta3.Document.Page.Table.detected_languages", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_DOCUMENT_PAGE_TABLE_TABLEROW, _DOCUMENT_PAGE_TABLE_TABLECELL,], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4484, - serialized_end=5126, -) - -_DOCUMENT_PAGE_FORMFIELD = _descriptor.Descriptor( - name="FormField", - full_name="google.cloud.documentai.v1beta3.Document.Page.FormField", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="field_name", - full_name="google.cloud.documentai.v1beta3.Document.Page.FormField.field_name", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="field_value", - full_name="google.cloud.documentai.v1beta3.Document.Page.FormField.field_value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="name_detected_languages", - full_name="google.cloud.documentai.v1beta3.Document.Page.FormField.name_detected_languages", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value_detected_languages", - full_name="google.cloud.documentai.v1beta3.Document.Page.FormField.value_detected_languages", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value_type", - full_name="google.cloud.documentai.v1beta3.Document.Page.FormField.value_type", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5129, - serialized_end=5508, -) - -_DOCUMENT_PAGE_DETECTEDLANGUAGE = _descriptor.Descriptor( - name="DetectedLanguage", - full_name="google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage.language_code", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5510, - serialized_end=5571, -) - -_DOCUMENT_PAGE = _descriptor.Descriptor( - name="Page", - full_name="google.cloud.documentai.v1beta3.Document.Page", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="page_number", - full_name="google.cloud.documentai.v1beta3.Document.Page.page_number", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="image", - full_name="google.cloud.documentai.v1beta3.Document.Page.image", - index=1, - number=13, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="transforms", - full_name="google.cloud.documentai.v1beta3.Document.Page.transforms", - index=2, - number=14, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="dimension", - full_name="google.cloud.documentai.v1beta3.Document.Page.dimension", - index=3, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="layout", - full_name="google.cloud.documentai.v1beta3.Document.Page.layout", - index=4, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="detected_languages", - full_name="google.cloud.documentai.v1beta3.Document.Page.detected_languages", - index=5, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="blocks", - full_name="google.cloud.documentai.v1beta3.Document.Page.blocks", - index=6, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="paragraphs", - full_name="google.cloud.documentai.v1beta3.Document.Page.paragraphs", - index=7, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="lines", - full_name="google.cloud.documentai.v1beta3.Document.Page.lines", - index=8, - number=7, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="tokens", - full_name="google.cloud.documentai.v1beta3.Document.Page.tokens", - index=9, - number=8, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="visual_elements", - full_name="google.cloud.documentai.v1beta3.Document.Page.visual_elements", - index=10, - number=9, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="tables", - full_name="google.cloud.documentai.v1beta3.Document.Page.tables", - index=11, - number=10, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="form_fields", - full_name="google.cloud.documentai.v1beta3.Document.Page.form_fields", - index=12, - number=11, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[ - _DOCUMENT_PAGE_DIMENSION, - _DOCUMENT_PAGE_IMAGE, - _DOCUMENT_PAGE_MATRIX, - _DOCUMENT_PAGE_LAYOUT, - _DOCUMENT_PAGE_BLOCK, - _DOCUMENT_PAGE_PARAGRAPH, - _DOCUMENT_PAGE_LINE, - _DOCUMENT_PAGE_TOKEN, - _DOCUMENT_PAGE_VISUALELEMENT, - _DOCUMENT_PAGE_TABLE, - _DOCUMENT_PAGE_FORMFIELD, - _DOCUMENT_PAGE_DETECTEDLANGUAGE, - ], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1523, - serialized_end=5571, -) - -_DOCUMENT_ENTITY_NORMALIZEDVALUE = _descriptor.Descriptor( - name="NormalizedValue", - full_name="google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="money_value", - full_name="google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue.money_value", - index=0, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="date_value", - full_name="google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue.date_value", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="datetime_value", - full_name="google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue.datetime_value", - index=2, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="address_value", - full_name="google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue.address_value", - index=3, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="text", - full_name="google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue.text", - index=4, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\340A\002", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="structured_value", - full_name="google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue.structured_value", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ), - ], - serialized_start=6107, - serialized_end=6349, -) - -_DOCUMENT_ENTITY = _descriptor.Descriptor( - name="Entity", - full_name="google.cloud.documentai.v1beta3.Document.Entity", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="text_anchor", - full_name="google.cloud.documentai.v1beta3.Document.Entity.text_anchor", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.documentai.v1beta3.Document.Entity.type", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="mention_text", - full_name="google.cloud.documentai.v1beta3.Document.Entity.mention_text", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="mention_id", - full_name="google.cloud.documentai.v1beta3.Document.Entity.mention_id", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.documentai.v1beta3.Document.Entity.confidence", - index=4, - number=5, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\340A\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="page_anchor", - full_name="google.cloud.documentai.v1beta3.Document.Entity.page_anchor", - index=5, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\340A\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="id", - full_name="google.cloud.documentai.v1beta3.Document.Entity.id", - index=6, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="normalized_value", - full_name="google.cloud.documentai.v1beta3.Document.Entity.normalized_value", - index=7, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\340A\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="properties", - full_name="google.cloud.documentai.v1beta3.Document.Entity.properties", - index=8, - number=10, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\340A\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="provenance", - full_name="google.cloud.documentai.v1beta3.Document.Entity.provenance", - index=9, - number=11, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\340A\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="redacted", - full_name="google.cloud.documentai.v1beta3.Document.Entity.redacted", - index=10, - number=12, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\340A\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_DOCUMENT_ENTITY_NORMALIZEDVALUE,], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5574, - serialized_end=6349, -) - -_DOCUMENT_ENTITYRELATION = _descriptor.Descriptor( - name="EntityRelation", - full_name="google.cloud.documentai.v1beta3.Document.EntityRelation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="subject_id", - full_name="google.cloud.documentai.v1beta3.Document.EntityRelation.subject_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="object_id", - full_name="google.cloud.documentai.v1beta3.Document.EntityRelation.object_id", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="relation", - full_name="google.cloud.documentai.v1beta3.Document.EntityRelation.relation", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6351, - serialized_end=6424, -) - -_DOCUMENT_TRANSLATION = _descriptor.Descriptor( - name="Translation", - full_name="google.cloud.documentai.v1beta3.Document.Translation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="text_anchor", - full_name="google.cloud.documentai.v1beta3.Document.Translation.text_anchor", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.documentai.v1beta3.Document.Translation.language_code", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="translated_text", - full_name="google.cloud.documentai.v1beta3.Document.Translation.translated_text", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="provenance", - full_name="google.cloud.documentai.v1beta3.Document.Translation.provenance", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6427, - serialized_end=6637, -) - -_DOCUMENT_TEXTANCHOR_TEXTSEGMENT = _descriptor.Descriptor( - name="TextSegment", - full_name="google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="start_index", - full_name="google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment.start_index", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="end_index", - full_name="google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment.end_index", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6760, - serialized_end=6813, -) - -_DOCUMENT_TEXTANCHOR = _descriptor.Descriptor( - name="TextAnchor", - full_name="google.cloud.documentai.v1beta3.Document.TextAnchor", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="text_segments", - full_name="google.cloud.documentai.v1beta3.Document.TextAnchor.text_segments", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="content", - full_name="google.cloud.documentai.v1beta3.Document.TextAnchor.content", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_DOCUMENT_TEXTANCHOR_TEXTSEGMENT,], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6640, - serialized_end=6813, -) - -_DOCUMENT_PAGEANCHOR_PAGEREF = _descriptor.Descriptor( - name="PageRef", - full_name="google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="page", - full_name="google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.page", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\340A\002", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="layout_type", - full_name="google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.layout_type", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\340A\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="layout_id", - full_name="google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.layout_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001\340A\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="bounding_poly", - full_name="google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\340A\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_DOCUMENT_PAGEANCHOR_PAGEREF_LAYOUTTYPE,], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6912, - serialized_end=7278, -) - -_DOCUMENT_PAGEANCHOR = _descriptor.Descriptor( - name="PageAnchor", - full_name="google.cloud.documentai.v1beta3.Document.PageAnchor", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="page_refs", - full_name="google.cloud.documentai.v1beta3.Document.PageAnchor.page_refs", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_DOCUMENT_PAGEANCHOR_PAGEREF,], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6816, - serialized_end=7278, -) - -_DOCUMENT_PROVENANCE_PARENT = _descriptor.Descriptor( - name="Parent", - full_name="google.cloud.documentai.v1beta3.Document.Provenance.Parent", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="revision", - full_name="google.cloud.documentai.v1beta3.Document.Provenance.Parent.revision", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="id", - full_name="google.cloud.documentai.v1beta3.Document.Provenance.Parent.id", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7485, - serialized_end=7523, -) - -_DOCUMENT_PROVENANCE = _descriptor.Descriptor( - name="Provenance", - full_name="google.cloud.documentai.v1beta3.Document.Provenance", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="revision", - full_name="google.cloud.documentai.v1beta3.Document.Provenance.revision", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="id", - full_name="google.cloud.documentai.v1beta3.Document.Provenance.id", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="parents", - full_name="google.cloud.documentai.v1beta3.Document.Provenance.parents", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.documentai.v1beta3.Document.Provenance.type", - index=3, - number=4, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_DOCUMENT_PROVENANCE_PARENT,], - enum_types=[_DOCUMENT_PROVENANCE_OPERATIONTYPE,], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7281, - serialized_end=7645, -) - -_DOCUMENT_REVISION_HUMANREVIEW = _descriptor.Descriptor( - name="HumanReview", - full_name="google.cloud.documentai.v1beta3.Document.Revision.HumanReview", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="state", - full_name="google.cloud.documentai.v1beta3.Document.Revision.HumanReview.state", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="state_message", - full_name="google.cloud.documentai.v1beta3.Document.Revision.HumanReview.state_message", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7861, - serialized_end=7912, -) - -_DOCUMENT_REVISION = _descriptor.Descriptor( - name="Revision", - full_name="google.cloud.documentai.v1beta3.Document.Revision", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="agent", - full_name="google.cloud.documentai.v1beta3.Document.Revision.agent", - index=0, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="processor", - full_name="google.cloud.documentai.v1beta3.Document.Revision.processor", - index=1, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="id", - full_name="google.cloud.documentai.v1beta3.Document.Revision.id", - index=2, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.documentai.v1beta3.Document.Revision.parent", - index=3, - number=2, - type=5, - cpp_type=1, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.documentai.v1beta3.Document.Revision.create_time", - index=4, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="human_review", - full_name="google.cloud.documentai.v1beta3.Document.Revision.human_review", - index=5, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_DOCUMENT_REVISION_HUMANREVIEW,], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="source", - full_name="google.cloud.documentai.v1beta3.Document.Revision.source", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ), - ], - serialized_start=7648, - serialized_end=7922, -) - -_DOCUMENT_TEXTCHANGE = _descriptor.Descriptor( - name="TextChange", - full_name="google.cloud.documentai.v1beta3.Document.TextChange", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="text_anchor", - full_name="google.cloud.documentai.v1beta3.Document.TextChange.text_anchor", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="changed_text", - full_name="google.cloud.documentai.v1beta3.Document.TextChange.changed_text", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="provenance", - full_name="google.cloud.documentai.v1beta3.Document.TextChange.provenance", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7925, - serialized_end=8108, -) - -_DOCUMENT = _descriptor.Descriptor( - name="Document", - full_name="google.cloud.documentai.v1beta3.Document", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="uri", - full_name="google.cloud.documentai.v1beta3.Document.uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="content", - full_name="google.cloud.documentai.v1beta3.Document.content", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="mime_type", - full_name="google.cloud.documentai.v1beta3.Document.mime_type", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="text", - full_name="google.cloud.documentai.v1beta3.Document.text", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="text_styles", - full_name="google.cloud.documentai.v1beta3.Document.text_styles", - index=4, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pages", - full_name="google.cloud.documentai.v1beta3.Document.pages", - index=5, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="entities", - full_name="google.cloud.documentai.v1beta3.Document.entities", - index=6, - number=7, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="entity_relations", - full_name="google.cloud.documentai.v1beta3.Document.entity_relations", - index=7, - number=8, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="translations", - full_name="google.cloud.documentai.v1beta3.Document.translations", - index=8, - number=12, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="text_changes", - full_name="google.cloud.documentai.v1beta3.Document.text_changes", - index=9, - number=14, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="shard_info", - full_name="google.cloud.documentai.v1beta3.Document.shard_info", - index=10, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="error", - full_name="google.cloud.documentai.v1beta3.Document.error", - index=11, - number=10, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="revisions", - full_name="google.cloud.documentai.v1beta3.Document.revisions", - index=12, - number=13, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[ - _DOCUMENT_SHARDINFO, - _DOCUMENT_STYLE, - _DOCUMENT_PAGE, - _DOCUMENT_ENTITY, - _DOCUMENT_ENTITYRELATION, - _DOCUMENT_TRANSLATION, - _DOCUMENT_TEXTANCHOR, - _DOCUMENT_PAGEANCHOR, - _DOCUMENT_PROVENANCE, - _DOCUMENT_REVISION, - _DOCUMENT_TEXTCHANGE, - ], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="source", - full_name="google.cloud.documentai.v1beta3.Document.source", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ), - ], - serialized_start=401, - serialized_end=8118, -) - -_DOCUMENT_SHARDINFO.containing_type = _DOCUMENT -_DOCUMENT_STYLE_FONTSIZE.containing_type = _DOCUMENT_STYLE -_DOCUMENT_STYLE.fields_by_name["text_anchor"].message_type = _DOCUMENT_TEXTANCHOR -_DOCUMENT_STYLE.fields_by_name[ - "color" -].message_type = google_dot_type_dot_color__pb2._COLOR -_DOCUMENT_STYLE.fields_by_name[ - "background_color" -].message_type = google_dot_type_dot_color__pb2._COLOR -_DOCUMENT_STYLE.fields_by_name["font_size"].message_type = _DOCUMENT_STYLE_FONTSIZE -_DOCUMENT_STYLE.containing_type = _DOCUMENT -_DOCUMENT_PAGE_DIMENSION.containing_type = _DOCUMENT_PAGE -_DOCUMENT_PAGE_IMAGE.containing_type = _DOCUMENT_PAGE -_DOCUMENT_PAGE_MATRIX.containing_type = _DOCUMENT_PAGE -_DOCUMENT_PAGE_LAYOUT.fields_by_name["text_anchor"].message_type = _DOCUMENT_TEXTANCHOR -_DOCUMENT_PAGE_LAYOUT.fields_by_name[ - "bounding_poly" -].message_type = ( - google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_DOCUMENT_PAGE_LAYOUT.fields_by_name[ - "orientation" -].enum_type = _DOCUMENT_PAGE_LAYOUT_ORIENTATION -_DOCUMENT_PAGE_LAYOUT.containing_type = _DOCUMENT_PAGE -_DOCUMENT_PAGE_LAYOUT_ORIENTATION.containing_type = _DOCUMENT_PAGE_LAYOUT -_DOCUMENT_PAGE_BLOCK.fields_by_name["layout"].message_type = _DOCUMENT_PAGE_LAYOUT -_DOCUMENT_PAGE_BLOCK.fields_by_name[ - "detected_languages" -].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE -_DOCUMENT_PAGE_BLOCK.fields_by_name["provenance"].message_type = _DOCUMENT_PROVENANCE -_DOCUMENT_PAGE_BLOCK.containing_type = _DOCUMENT_PAGE -_DOCUMENT_PAGE_PARAGRAPH.fields_by_name["layout"].message_type = _DOCUMENT_PAGE_LAYOUT -_DOCUMENT_PAGE_PARAGRAPH.fields_by_name[ - "detected_languages" -].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE -_DOCUMENT_PAGE_PARAGRAPH.fields_by_name[ - "provenance" -].message_type = _DOCUMENT_PROVENANCE -_DOCUMENT_PAGE_PARAGRAPH.containing_type = _DOCUMENT_PAGE -_DOCUMENT_PAGE_LINE.fields_by_name["layout"].message_type = _DOCUMENT_PAGE_LAYOUT -_DOCUMENT_PAGE_LINE.fields_by_name[ - "detected_languages" -].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE -_DOCUMENT_PAGE_LINE.fields_by_name["provenance"].message_type = _DOCUMENT_PROVENANCE -_DOCUMENT_PAGE_LINE.containing_type = _DOCUMENT_PAGE -_DOCUMENT_PAGE_TOKEN_DETECTEDBREAK.fields_by_name[ - "type" -].enum_type = _DOCUMENT_PAGE_TOKEN_DETECTEDBREAK_TYPE -_DOCUMENT_PAGE_TOKEN_DETECTEDBREAK.containing_type = _DOCUMENT_PAGE_TOKEN -_DOCUMENT_PAGE_TOKEN_DETECTEDBREAK_TYPE.containing_type = ( - _DOCUMENT_PAGE_TOKEN_DETECTEDBREAK -) -_DOCUMENT_PAGE_TOKEN.fields_by_name["layout"].message_type = _DOCUMENT_PAGE_LAYOUT -_DOCUMENT_PAGE_TOKEN.fields_by_name[ - "detected_break" -].message_type = _DOCUMENT_PAGE_TOKEN_DETECTEDBREAK -_DOCUMENT_PAGE_TOKEN.fields_by_name[ - "detected_languages" -].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE -_DOCUMENT_PAGE_TOKEN.fields_by_name["provenance"].message_type = _DOCUMENT_PROVENANCE -_DOCUMENT_PAGE_TOKEN.containing_type = _DOCUMENT_PAGE -_DOCUMENT_PAGE_VISUALELEMENT.fields_by_name[ - "layout" -].message_type = _DOCUMENT_PAGE_LAYOUT -_DOCUMENT_PAGE_VISUALELEMENT.fields_by_name[ - "detected_languages" -].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE -_DOCUMENT_PAGE_VISUALELEMENT.containing_type = _DOCUMENT_PAGE -_DOCUMENT_PAGE_TABLE_TABLEROW.fields_by_name[ - "cells" -].message_type = _DOCUMENT_PAGE_TABLE_TABLECELL -_DOCUMENT_PAGE_TABLE_TABLEROW.containing_type = _DOCUMENT_PAGE_TABLE -_DOCUMENT_PAGE_TABLE_TABLECELL.fields_by_name[ - "layout" -].message_type = _DOCUMENT_PAGE_LAYOUT -_DOCUMENT_PAGE_TABLE_TABLECELL.fields_by_name[ - "detected_languages" -].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE -_DOCUMENT_PAGE_TABLE_TABLECELL.containing_type = _DOCUMENT_PAGE_TABLE -_DOCUMENT_PAGE_TABLE.fields_by_name["layout"].message_type = _DOCUMENT_PAGE_LAYOUT -_DOCUMENT_PAGE_TABLE.fields_by_name[ - "header_rows" -].message_type = _DOCUMENT_PAGE_TABLE_TABLEROW -_DOCUMENT_PAGE_TABLE.fields_by_name[ - "body_rows" -].message_type = _DOCUMENT_PAGE_TABLE_TABLEROW -_DOCUMENT_PAGE_TABLE.fields_by_name[ - "detected_languages" -].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE -_DOCUMENT_PAGE_TABLE.containing_type = _DOCUMENT_PAGE -_DOCUMENT_PAGE_FORMFIELD.fields_by_name[ - "field_name" -].message_type = _DOCUMENT_PAGE_LAYOUT -_DOCUMENT_PAGE_FORMFIELD.fields_by_name[ - "field_value" -].message_type = _DOCUMENT_PAGE_LAYOUT -_DOCUMENT_PAGE_FORMFIELD.fields_by_name[ - "name_detected_languages" -].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE -_DOCUMENT_PAGE_FORMFIELD.fields_by_name[ - "value_detected_languages" -].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE -_DOCUMENT_PAGE_FORMFIELD.containing_type = _DOCUMENT_PAGE -_DOCUMENT_PAGE_DETECTEDLANGUAGE.containing_type = _DOCUMENT_PAGE -_DOCUMENT_PAGE.fields_by_name["image"].message_type = _DOCUMENT_PAGE_IMAGE -_DOCUMENT_PAGE.fields_by_name["transforms"].message_type = _DOCUMENT_PAGE_MATRIX -_DOCUMENT_PAGE.fields_by_name["dimension"].message_type = _DOCUMENT_PAGE_DIMENSION -_DOCUMENT_PAGE.fields_by_name["layout"].message_type = _DOCUMENT_PAGE_LAYOUT -_DOCUMENT_PAGE.fields_by_name[ - "detected_languages" -].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE -_DOCUMENT_PAGE.fields_by_name["blocks"].message_type = _DOCUMENT_PAGE_BLOCK -_DOCUMENT_PAGE.fields_by_name["paragraphs"].message_type = _DOCUMENT_PAGE_PARAGRAPH -_DOCUMENT_PAGE.fields_by_name["lines"].message_type = _DOCUMENT_PAGE_LINE -_DOCUMENT_PAGE.fields_by_name["tokens"].message_type = _DOCUMENT_PAGE_TOKEN -_DOCUMENT_PAGE.fields_by_name[ - "visual_elements" -].message_type = _DOCUMENT_PAGE_VISUALELEMENT -_DOCUMENT_PAGE.fields_by_name["tables"].message_type = _DOCUMENT_PAGE_TABLE -_DOCUMENT_PAGE.fields_by_name["form_fields"].message_type = _DOCUMENT_PAGE_FORMFIELD -_DOCUMENT_PAGE.containing_type = _DOCUMENT -_DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name[ - "money_value" -].message_type = google_dot_type_dot_money__pb2._MONEY -_DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name[ - "date_value" -].message_type = google_dot_type_dot_date__pb2._DATE -_DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name[ - "datetime_value" -].message_type = google_dot_type_dot_datetime__pb2._DATETIME -_DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name[ - "address_value" -].message_type = google_dot_type_dot_postal__address__pb2._POSTALADDRESS -_DOCUMENT_ENTITY_NORMALIZEDVALUE.containing_type = _DOCUMENT_ENTITY -_DOCUMENT_ENTITY_NORMALIZEDVALUE.oneofs_by_name["structured_value"].fields.append( - _DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name["money_value"] -) -_DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name[ - "money_value" -].containing_oneof = _DOCUMENT_ENTITY_NORMALIZEDVALUE.oneofs_by_name["structured_value"] -_DOCUMENT_ENTITY_NORMALIZEDVALUE.oneofs_by_name["structured_value"].fields.append( - _DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name["date_value"] -) -_DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name[ - "date_value" -].containing_oneof = _DOCUMENT_ENTITY_NORMALIZEDVALUE.oneofs_by_name["structured_value"] -_DOCUMENT_ENTITY_NORMALIZEDVALUE.oneofs_by_name["structured_value"].fields.append( - _DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name["datetime_value"] -) -_DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name[ - "datetime_value" -].containing_oneof = _DOCUMENT_ENTITY_NORMALIZEDVALUE.oneofs_by_name["structured_value"] -_DOCUMENT_ENTITY_NORMALIZEDVALUE.oneofs_by_name["structured_value"].fields.append( - _DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name["address_value"] -) -_DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name[ - "address_value" -].containing_oneof = _DOCUMENT_ENTITY_NORMALIZEDVALUE.oneofs_by_name["structured_value"] -_DOCUMENT_ENTITY.fields_by_name["text_anchor"].message_type = _DOCUMENT_TEXTANCHOR -_DOCUMENT_ENTITY.fields_by_name["page_anchor"].message_type = _DOCUMENT_PAGEANCHOR -_DOCUMENT_ENTITY.fields_by_name[ - "normalized_value" -].message_type = _DOCUMENT_ENTITY_NORMALIZEDVALUE -_DOCUMENT_ENTITY.fields_by_name["properties"].message_type = _DOCUMENT_ENTITY -_DOCUMENT_ENTITY.fields_by_name["provenance"].message_type = _DOCUMENT_PROVENANCE -_DOCUMENT_ENTITY.containing_type = _DOCUMENT -_DOCUMENT_ENTITYRELATION.containing_type = _DOCUMENT -_DOCUMENT_TRANSLATION.fields_by_name["text_anchor"].message_type = _DOCUMENT_TEXTANCHOR -_DOCUMENT_TRANSLATION.fields_by_name["provenance"].message_type = _DOCUMENT_PROVENANCE -_DOCUMENT_TRANSLATION.containing_type = _DOCUMENT -_DOCUMENT_TEXTANCHOR_TEXTSEGMENT.containing_type = _DOCUMENT_TEXTANCHOR -_DOCUMENT_TEXTANCHOR.fields_by_name[ - "text_segments" -].message_type = _DOCUMENT_TEXTANCHOR_TEXTSEGMENT -_DOCUMENT_TEXTANCHOR.containing_type = _DOCUMENT -_DOCUMENT_PAGEANCHOR_PAGEREF.fields_by_name[ - "layout_type" -].enum_type = _DOCUMENT_PAGEANCHOR_PAGEREF_LAYOUTTYPE -_DOCUMENT_PAGEANCHOR_PAGEREF.fields_by_name[ - "bounding_poly" -].message_type = ( - google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_DOCUMENT_PAGEANCHOR_PAGEREF.containing_type = _DOCUMENT_PAGEANCHOR -_DOCUMENT_PAGEANCHOR_PAGEREF_LAYOUTTYPE.containing_type = _DOCUMENT_PAGEANCHOR_PAGEREF -_DOCUMENT_PAGEANCHOR.fields_by_name[ - "page_refs" -].message_type = _DOCUMENT_PAGEANCHOR_PAGEREF -_DOCUMENT_PAGEANCHOR.containing_type = _DOCUMENT -_DOCUMENT_PROVENANCE_PARENT.containing_type = _DOCUMENT_PROVENANCE -_DOCUMENT_PROVENANCE.fields_by_name[ - "parents" -].message_type = _DOCUMENT_PROVENANCE_PARENT -_DOCUMENT_PROVENANCE.fields_by_name[ - "type" -].enum_type = _DOCUMENT_PROVENANCE_OPERATIONTYPE -_DOCUMENT_PROVENANCE.containing_type = _DOCUMENT -_DOCUMENT_PROVENANCE_OPERATIONTYPE.containing_type = _DOCUMENT_PROVENANCE -_DOCUMENT_REVISION_HUMANREVIEW.containing_type = _DOCUMENT_REVISION -_DOCUMENT_REVISION.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_DOCUMENT_REVISION.fields_by_name[ - "human_review" -].message_type = _DOCUMENT_REVISION_HUMANREVIEW -_DOCUMENT_REVISION.containing_type = _DOCUMENT -_DOCUMENT_REVISION.oneofs_by_name["source"].fields.append( - _DOCUMENT_REVISION.fields_by_name["agent"] -) -_DOCUMENT_REVISION.fields_by_name[ - "agent" -].containing_oneof = _DOCUMENT_REVISION.oneofs_by_name["source"] -_DOCUMENT_REVISION.oneofs_by_name["source"].fields.append( - _DOCUMENT_REVISION.fields_by_name["processor"] -) -_DOCUMENT_REVISION.fields_by_name[ - "processor" -].containing_oneof = _DOCUMENT_REVISION.oneofs_by_name["source"] -_DOCUMENT_TEXTCHANGE.fields_by_name["text_anchor"].message_type = _DOCUMENT_TEXTANCHOR -_DOCUMENT_TEXTCHANGE.fields_by_name["provenance"].message_type = _DOCUMENT_PROVENANCE -_DOCUMENT_TEXTCHANGE.containing_type = _DOCUMENT -_DOCUMENT.fields_by_name["text_styles"].message_type = _DOCUMENT_STYLE -_DOCUMENT.fields_by_name["pages"].message_type = _DOCUMENT_PAGE -_DOCUMENT.fields_by_name["entities"].message_type = _DOCUMENT_ENTITY -_DOCUMENT.fields_by_name["entity_relations"].message_type = _DOCUMENT_ENTITYRELATION -_DOCUMENT.fields_by_name["translations"].message_type = _DOCUMENT_TRANSLATION -_DOCUMENT.fields_by_name["text_changes"].message_type = _DOCUMENT_TEXTCHANGE -_DOCUMENT.fields_by_name["shard_info"].message_type = _DOCUMENT_SHARDINFO -_DOCUMENT.fields_by_name["error"].message_type = google_dot_rpc_dot_status__pb2._STATUS -_DOCUMENT.fields_by_name["revisions"].message_type = _DOCUMENT_REVISION -_DOCUMENT.oneofs_by_name["source"].fields.append(_DOCUMENT.fields_by_name["uri"]) -_DOCUMENT.fields_by_name["uri"].containing_oneof = _DOCUMENT.oneofs_by_name["source"] -_DOCUMENT.oneofs_by_name["source"].fields.append(_DOCUMENT.fields_by_name["content"]) -_DOCUMENT.fields_by_name["content"].containing_oneof = _DOCUMENT.oneofs_by_name[ - "source" -] -DESCRIPTOR.message_types_by_name["Document"] = _DOCUMENT -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Document = _reflection.GeneratedProtocolMessageType( - "Document", - (_message.Message,), - { - "ShardInfo": _reflection.GeneratedProtocolMessageType( - "ShardInfo", - (_message.Message,), - { - "DESCRIPTOR": _DOCUMENT_SHARDINFO, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """For a large document, sharding may be performed to produce several - document shards. Each document shard contains this field to detail - which shard it is. - - Attributes: - shard_index: - The 0-based index of this shard. - shard_count: - Total number of shards. - text_offset: - The index of the first character in - [Document.text][google.cloud.documentai.v1beta3.Document.text] - in the overall document global text. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.ShardInfo) - }, - ), - "Style": _reflection.GeneratedProtocolMessageType( - "Style", - (_message.Message,), - { - "FontSize": _reflection.GeneratedProtocolMessageType( - "FontSize", - (_message.Message,), - { - "DESCRIPTOR": _DOCUMENT_STYLE_FONTSIZE, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """Font size with unit. - - Attributes: - size: - Font size for the text. - unit: - Unit for the font size. Follows CSS naming (in, px, pt, etc.). - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Style.FontSize) - }, - ), - "DESCRIPTOR": _DOCUMENT_STYLE, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """Annotation for common text style attributes. This adheres to CSS - conventions as much as possible. - - Attributes: - text_anchor: - Text anchor indexing into the [Document.text][google.cloud.doc - umentai.v1beta3.Document.text]. - color: - Text color. - background_color: - Text background color. - font_weight: - Font weight. Possible values are normal, bold, bolder, and - lighter. https://www.w3schools.com/cssref/pr_font_weight.asp - text_style: - Text style. Possible values are normal, italic, and oblique. - https://www.w3schools.com/cssref/pr_font_font-style.asp - text_decoration: - Text decoration. Follows CSS standard. - https://www.w3schools.com/cssref/pr_text_text-decoration.asp - font_size: - Font size. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Style) - }, - ), - "Page": _reflection.GeneratedProtocolMessageType( - "Page", - (_message.Message,), - { - "Dimension": _reflection.GeneratedProtocolMessageType( - "Dimension", - (_message.Message,), - { - "DESCRIPTOR": _DOCUMENT_PAGE_DIMENSION, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """Dimension for the page. - - Attributes: - width: - Page width. - height: - Page height. - unit: - Dimension unit. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.Dimension) - }, - ), - "Image": _reflection.GeneratedProtocolMessageType( - "Image", - (_message.Message,), - { - "DESCRIPTOR": _DOCUMENT_PAGE_IMAGE, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """Rendered image contents for this page. - - Attributes: - content: - Raw byte content of the image. - mime_type: - Encoding mime type for the image. - width: - Width of the image in pixels. - height: - Height of the image in pixels. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.Image) - }, - ), - "Matrix": _reflection.GeneratedProtocolMessageType( - "Matrix", - (_message.Message,), - { - "DESCRIPTOR": _DOCUMENT_PAGE_MATRIX, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """Representation for transformation matrix, intended to be compatible - and used with OpenCV format for image manipulation. - - Attributes: - rows: - Number of rows in the matrix. - cols: - Number of columns in the matrix. - type: - This encodes information about what data type the matrix uses. - For example, 0 (CV_8U) is an unsigned 8-bit image. For the - full list of OpenCV primitive data types, please refer to http - s://docs.opencv.org/4.3.0/d1/d1b/group__core__hal__interface.h - tml - data: - The matrix data. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.Matrix) - }, - ), - "Layout": _reflection.GeneratedProtocolMessageType( - "Layout", - (_message.Message,), - { - "DESCRIPTOR": _DOCUMENT_PAGE_LAYOUT, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """Visual element describing a layout unit on a page. - - Attributes: - text_anchor: - Text anchor indexing into the [Document.text][google.cloud.doc - umentai.v1beta3.Document.text]. - confidence: - Confidence of the current - [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] - within context of the object this layout is for. - e.g. confidence can be for a single token, a table, a visual - element, etc. depending on context. Range [0, 1]. - bounding_poly: - The bounding polygon for the [Layout][google.cloud.documentai. - v1beta3.Document.Page.Layout]. - orientation: - Detected orientation for the [Layout][google.cloud.documentai. - v1beta3.Document.Page.Layout]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.Layout) - }, - ), - "Block": _reflection.GeneratedProtocolMessageType( - "Block", - (_message.Message,), - { - "DESCRIPTOR": _DOCUMENT_PAGE_BLOCK, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """A block has a set of lines (collected into paragraphs) that have a - common line-spacing and orientation. - - Attributes: - layout: - [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] - for - [Block][google.cloud.documentai.v1beta3.Document.Page.Block]. - detected_languages: - A list of detected languages together with confidence. - provenance: - The history of this annotation. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.Block) - }, - ), - "Paragraph": _reflection.GeneratedProtocolMessageType( - "Paragraph", - (_message.Message,), - { - "DESCRIPTOR": _DOCUMENT_PAGE_PARAGRAPH, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """A collection of lines that a human would perceive as a paragraph. - - Attributes: - layout: - [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] - for [Paragraph][google.cloud.documentai.v1beta3.Document.Page. - Paragraph]. - detected_languages: - A list of detected languages together with confidence. - provenance: - The history of this annotation. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.Paragraph) - }, - ), - "Line": _reflection.GeneratedProtocolMessageType( - "Line", - (_message.Message,), - { - "DESCRIPTOR": _DOCUMENT_PAGE_LINE, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """A collection of tokens that a human would perceive as a line. Does not - cross column boundaries, can be horizontal, vertical, etc. - - Attributes: - layout: - [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] - for - [Line][google.cloud.documentai.v1beta3.Document.Page.Line]. - detected_languages: - A list of detected languages together with confidence. - provenance: - The history of this annotation. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.Line) - }, - ), - "Token": _reflection.GeneratedProtocolMessageType( - "Token", - (_message.Message,), - { - "DetectedBreak": _reflection.GeneratedProtocolMessageType( - "DetectedBreak", - (_message.Message,), - { - "DESCRIPTOR": _DOCUMENT_PAGE_TOKEN_DETECTEDBREAK, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """Detected break at the end of a - [Token][google.cloud.documentai.v1beta3.Document.Page.Token]. - - Attributes: - type: - Detected break type. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak) - }, - ), - "DESCRIPTOR": _DOCUMENT_PAGE_TOKEN, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """A detected token. - - Attributes: - layout: - [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] - for - [Token][google.cloud.documentai.v1beta3.Document.Page.Token]. - detected_break: - Detected break at the end of a - [Token][google.cloud.documentai.v1beta3.Document.Page.Token]. - detected_languages: - A list of detected languages together with confidence. - provenance: - The history of this annotation. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.Token) - }, - ), - "VisualElement": _reflection.GeneratedProtocolMessageType( - "VisualElement", - (_message.Message,), - { - "DESCRIPTOR": _DOCUMENT_PAGE_VISUALELEMENT, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """Detected non-text visual elements e.g. checkbox, signature etc. on the - page. - - Attributes: - layout: - [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] - for [VisualElement][google.cloud.documentai.v1beta3.Document.P - age.VisualElement]. - type: - Type of the [VisualElement][google.cloud.documentai.v1beta3.Do - cument.Page.VisualElement]. - detected_languages: - A list of detected languages together with confidence. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.VisualElement) - }, - ), - "Table": _reflection.GeneratedProtocolMessageType( - "Table", - (_message.Message,), - { - "TableRow": _reflection.GeneratedProtocolMessageType( - "TableRow", - (_message.Message,), - { - "DESCRIPTOR": _DOCUMENT_PAGE_TABLE_TABLEROW, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """A row of table cells. - - Attributes: - cells: - Cells that make up this row. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.Table.TableRow) - }, - ), - "TableCell": _reflection.GeneratedProtocolMessageType( - "TableCell", - (_message.Message,), - { - "DESCRIPTOR": _DOCUMENT_PAGE_TABLE_TABLECELL, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """A cell representation inside the table. - - Attributes: - layout: - [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] - for [TableCell][google.cloud.documentai.v1beta3.Document.Page. - Table.TableCell]. - row_span: - How many rows this cell spans. - col_span: - How many columns this cell spans. - detected_languages: - A list of detected languages together with confidence. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.Table.TableCell) - }, - ), - "DESCRIPTOR": _DOCUMENT_PAGE_TABLE, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """A table representation similar to HTML table structure. - - Attributes: - layout: - [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] - for - [Table][google.cloud.documentai.v1beta3.Document.Page.Table]. - header_rows: - Header rows of the table. - body_rows: - Body rows of the table. - detected_languages: - A list of detected languages together with confidence. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.Table) - }, - ), - "FormField": _reflection.GeneratedProtocolMessageType( - "FormField", - (_message.Message,), - { - "DESCRIPTOR": _DOCUMENT_PAGE_FORMFIELD, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """A form field detected on the page. - - Attributes: - field_name: - [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] - for the [FormField][google.cloud.documentai.v1beta3.Document.P - age.FormField] name. e.g. ``Address``, ``Email``, ``Grand - total``, ``Phone number``, etc. - field_value: - [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] - for the [FormField][google.cloud.documentai.v1beta3.Document.P - age.FormField] value. - name_detected_languages: - A list of detected languages for name together with - confidence. - value_detected_languages: - A list of detected languages for value together with - confidence. - value_type: - If the value is non-textual, this field represents the type. - Current valid values are: - blank (this indicates the - field_value is normal text) - “unfilled_checkbox” - - “filled_checkbox” - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.FormField) - }, - ), - "DetectedLanguage": _reflection.GeneratedProtocolMessageType( - "DetectedLanguage", - (_message.Message,), - { - "DESCRIPTOR": _DOCUMENT_PAGE_DETECTEDLANGUAGE, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """Detected language for a structural component. - - Attributes: - language_code: - The BCP-47 language code, such as “en-US” or “sr-Latn”. For - more information, see http://www.unicode.org/reports/tr35/#Uni - code_locale_identifier. - confidence: - Confidence of detected language. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage) - }, - ), - "DESCRIPTOR": _DOCUMENT_PAGE, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """A page in a [Document][google.cloud.documentai.v1beta3.Document]. - - Attributes: - page_number: - 1-based index for current - [Page][google.cloud.documentai.v1beta3.Document.Page] in a - parent [Document][google.cloud.documentai.v1beta3.Document]. - Useful when a page is taken out of a - [Document][google.cloud.documentai.v1beta3.Document] for - individual processing. - image: - Rendered image for this page. This image is preprocessed to - remove any skew, rotation, and distortions such that the - annotation bounding boxes can be upright and axis-aligned. - transforms: - Transformation matrices that were applied to the original - document image to produce [Page.image][google.cloud.documentai - .v1beta3.Document.Page.image]. - dimension: - Physical dimension of the page. - layout: - [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] - for the page. - detected_languages: - A list of detected languages together with confidence. - blocks: - A list of visually detected text blocks on the page. A block - has a set of lines (collected into paragraphs) that have a - common line-spacing and orientation. - paragraphs: - A list of visually detected text paragraphs on the page. A - collection of lines that a human would perceive as a - paragraph. - lines: - A list of visually detected text lines on the page. A - collection of tokens that a human would perceive as a line. - tokens: - A list of visually detected tokens on the page. - visual_elements: - A list of detected non-text visual elements e.g. checkbox, - signature etc. on the page. - tables: - A list of visually detected tables on the page. - form_fields: - A list of visually detected form fields on the page. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page) - }, - ), - "Entity": _reflection.GeneratedProtocolMessageType( - "Entity", - (_message.Message,), - { - "NormalizedValue": _reflection.GeneratedProtocolMessageType( - "NormalizedValue", - (_message.Message,), - { - "DESCRIPTOR": _DOCUMENT_ENTITY_NORMALIZEDVALUE, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """Parsed and normalized entity value. - - Attributes: - structured_value: - Structured entity value. Must match entity type defined in - schema if known. If this field is present, the ‘text’ field is - still populated. - money_value: - Money value. See also: https: github.com/googleapis/googleapi - s/blob/master/google/type/money.proto - date_value: - Date value. Includes year, month, day. See also: https: githu - b.com/googleapis/googleapis/blob/master/google/type/date.proto - datetime_value: - DateTime value. Includes date, time, and timezone. See also: - https: github.com/googleapis/googleapis/blob/master/google/typ - e/datetime.proto - address_value: - Postal address. See also: https: github.com/googleapis/google - apis/blob/master/google/type/postal_address.proto - text: - Required. Normalized entity value stored as a string. This - field is populated for supported document type (e.g. Invoice). - For some entity types, one of respective ‘structured_value’ - fields may also be populated. - Money/Currency type - (``money_value``) is in the ISO 4217 text format. - Date type - (``date_value``) is in the ISO 8601 text format. - Datetime - type (``datetime_value``) is in the ISO 8601 text format. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue) - }, - ), - "DESCRIPTOR": _DOCUMENT_ENTITY, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """A phrase in the text that is a known entity type, such as a person, an - organization, or location. - - Attributes: - text_anchor: - Provenance of the entity. Text anchor indexing into the [Docum - ent.text][google.cloud.documentai.v1beta3.Document.text]. - type: - Entity type from a schema e.g. ``Address``. - mention_text: - Text value in the document e.g. ``1600 Amphitheatre Pkwy``. - mention_id: - Deprecated. Use ``id`` field instead. - confidence: - Optional. Confidence of detected Schema entity. Range [0, 1]. - page_anchor: - Optional. Represents the provenance of this entity wrt. the - location on the page where it was found. - id: - Canonical id. This will be a unique value in the entity list - for this document. - normalized_value: - Optional. Normalized entity value. Absent if the extracted - value could not be converted or the type (e.g. address) is not - supported for certain parsers. This field is also only - populated for certain supported document types. - properties: - Optional. Entities can be nested to form a hierarchical data - structure representing the content in the document. - provenance: - Optional. The history of this annotation. - redacted: - Optional. Whether the entity will be redacted for de- - identification purposes. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Entity) - }, - ), - "EntityRelation": _reflection.GeneratedProtocolMessageType( - "EntityRelation", - (_message.Message,), - { - "DESCRIPTOR": _DOCUMENT_ENTITYRELATION, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """Relationship between - [Entities][google.cloud.documentai.v1beta3.Document.Entity]. - - Attributes: - subject_id: - Subject entity id. - object_id: - Object entity id. - relation: - Relationship description. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.EntityRelation) - }, - ), - "Translation": _reflection.GeneratedProtocolMessageType( - "Translation", - (_message.Message,), - { - "DESCRIPTOR": _DOCUMENT_TRANSLATION, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """A translation of the text segment. - - Attributes: - text_anchor: - Provenance of the translation. Text anchor indexing into the [ - Document.text][google.cloud.documentai.v1beta3.Document.text]. - There can only be a single ``TextAnchor.text_segments`` - element. If the start and end index of the text segment are - the same, the text change is inserted before that index. - language_code: - The BCP-47 language code, such as “en-US” or “sr-Latn”. For - more information, see http://www.unicode.org/reports/tr35/#Uni - code_locale_identifier. - translated_text: - Text translated into the target language. - provenance: - The history of this annotation. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Translation) - }, - ), - "TextAnchor": _reflection.GeneratedProtocolMessageType( - "TextAnchor", - (_message.Message,), - { - "TextSegment": _reflection.GeneratedProtocolMessageType( - "TextSegment", - (_message.Message,), - { - "DESCRIPTOR": _DOCUMENT_TEXTANCHOR_TEXTSEGMENT, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """A text segment in the - [Document.text][google.cloud.documentai.v1beta3.Document.text]. The - indices may be out of bounds which indicate that the text extends into - another document shard for large sharded documents. See [ShardInfo.tex - t_offset][google.cloud.documentai.v1beta3.Document.ShardInfo.text_offs - et] - - Attributes: - start_index: - [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnc - hor.TextSegment] start UTF-8 char index in the [Document.text] - [google.cloud.documentai.v1beta3.Document.text]. - end_index: - [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnc - hor.TextSegment] half open end UTF-8 char index in the [Docume - nt.text][google.cloud.documentai.v1beta3.Document.text]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment) - }, - ), - "DESCRIPTOR": _DOCUMENT_TEXTANCHOR, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """Text reference indexing into the - [Document.text][google.cloud.documentai.v1beta3.Document.text]. - - Attributes: - text_segments: - The text segments from the [Document.text][google.cloud.docume - ntai.v1beta3.Document.text]. - content: - Contains the content of the text span so that users do not - have to look it up in the text_segments. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.TextAnchor) - }, - ), - "PageAnchor": _reflection.GeneratedProtocolMessageType( - "PageAnchor", - (_message.Message,), - { - "PageRef": _reflection.GeneratedProtocolMessageType( - "PageRef", - (_message.Message,), - { - "DESCRIPTOR": _DOCUMENT_PAGEANCHOR_PAGEREF, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """Represents a weak reference to a page element within a document. - - Attributes: - page: - Required. Index into the [Document.pages][google.cloud.documen - tai.v1beta3.Document.pages] element - layout_type: - Optional. The type of the layout element that is being - referenced if any. - layout_id: - Optional. Deprecated. Use [PageRef.bounding_poly][google.cloud - .documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly] - instead. - bounding_poly: - Optional. Identifies the bounding polygon of a layout element - on the page. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef) - }, - ), - "DESCRIPTOR": _DOCUMENT_PAGEANCHOR, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """Referencing the visual context of the entity in the - [Document.pages][google.cloud.documentai.v1beta3.Document.pages]. Page - anchors can be cross-page, consist of multiple bounding polygons and - optionally reference specific layout element types. - - Attributes: - page_refs: - One or more references to visual page elements - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.PageAnchor) - }, - ), - "Provenance": _reflection.GeneratedProtocolMessageType( - "Provenance", - (_message.Message,), - { - "Parent": _reflection.GeneratedProtocolMessageType( - "Parent", - (_message.Message,), - { - "DESCRIPTOR": _DOCUMENT_PROVENANCE_PARENT, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """Structure for referencing parent provenances. When an element replaces - one of more other elements parent references identify the elements - that are replaced. - - Attributes: - revision: - The index of the [Document.revisions] identifying the parent - revision. - id: - The id of the parent provenance. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Provenance.Parent) - }, - ), - "DESCRIPTOR": _DOCUMENT_PROVENANCE, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """Structure to identify provenance relationships between annotations in - different revisions. - - Attributes: - revision: - The index of the revision that produced this element. - id: - The Id of this operation. Needs to be unique within the scope - of the revision. - parents: - References to the original elements that are replaced. - type: - The type of provenance operation. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Provenance) - }, - ), - "Revision": _reflection.GeneratedProtocolMessageType( - "Revision", - (_message.Message,), - { - "HumanReview": _reflection.GeneratedProtocolMessageType( - "HumanReview", - (_message.Message,), - { - "DESCRIPTOR": _DOCUMENT_REVISION_HUMANREVIEW, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """Human Review information of the document. - - Attributes: - state: - Human review state. e.g. ``requested``, ``succeeded``, - ``rejected``. - state_message: - A message providing more details about the current state of - processing. For example, the rejection reason when the state - is ``rejected``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Revision.HumanReview) - }, - ), - "DESCRIPTOR": _DOCUMENT_REVISION, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """Contains past or forward revisions of this document. - - Attributes: - source: - Who/what made the change - agent: - If the change was made by a person specify the name or id of - that person. - processor: - If the annotation was made by processor identify the processor - by its resource name. - id: - Id of the revision. Unique within the context of the document. - parent: - The revisions that this revision is based on. This can include - one or more parent (when documents are merged.) This field - represents the index into the ``revisions`` field. - create_time: - The time that the revision was created. - human_review: - Human Review information of this revision. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Revision) - }, - ), - "TextChange": _reflection.GeneratedProtocolMessageType( - "TextChange", - (_message.Message,), - { - "DESCRIPTOR": _DOCUMENT_TEXTCHANGE, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """This message is used for text changes aka. OCR corrections. - - Attributes: - text_anchor: - Provenance of the correction. Text anchor indexing into the [D - ocument.text][google.cloud.documentai.v1beta3.Document.text]. - There can only be a single ``TextAnchor.text_segments`` - element. If the start and end index of the text segment are - the same, the text change is inserted before that index. - changed_text: - The text that replaces the text identified in the - ``text_anchor``. - provenance: - The history of this annotation. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.TextChange) - }, - ), - "DESCRIPTOR": _DOCUMENT, - "__module__": "google.cloud.documentai_v1beta3.proto.document_pb2", - "__doc__": """Document represents the canonical document resource in Document - Understanding AI. It is an interchange format that provides insights - into documents and allows for collaboration between users and Document - Understanding AI to iterate and optimize for quality. - - Attributes: - source: - Original source document from the user. - uri: - Currently supports Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not - supported. See `Google Cloud Storage Request URIs - `__ for - more info. - content: - Inline document content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers use a pure - binary representation, whereas JSON representations use - base64. - mime_type: - An IANA published MIME type (also referred to as media type). - For more information, see - https://www.iana.org/assignments/media-types/media- - types.xhtml. - text: - UTF-8 encoded text in reading order from the document. - text_styles: - Styles for the [Document.text][google.cloud.documentai.v1beta3 - .Document.text]. - pages: - Visual page layout for the - [Document][google.cloud.documentai.v1beta3.Document]. - entities: - A list of entities detected on [Document.text][google.cloud.do - cumentai.v1beta3.Document.text]. For document shards, entities - in this list may cross shard boundaries. - entity_relations: - Relationship among [Document.entities][google.cloud.documentai - .v1beta3.Document.entities]. - translations: - A list of translations on [Document.text][google.cloud.documen - tai.v1beta3.Document.text]. For document shards, translations - in this list may cross shard boundaries. - text_changes: - A list of text corrections made to [Document.text]. This is - usually used for annotating corrections to OCR mistakes. Text - changes for a given revision may not overlap with each other. - shard_info: - Information about the sharding if this document is sharded - part of a larger document. If the document is not sharded, - this message is not specified. - error: - Any error that occurred while processing this document. - revisions: - Revision history of this document. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document) - }, -) -_sym_db.RegisterMessage(Document) -_sym_db.RegisterMessage(Document.ShardInfo) -_sym_db.RegisterMessage(Document.Style) -_sym_db.RegisterMessage(Document.Style.FontSize) -_sym_db.RegisterMessage(Document.Page) -_sym_db.RegisterMessage(Document.Page.Dimension) -_sym_db.RegisterMessage(Document.Page.Image) -_sym_db.RegisterMessage(Document.Page.Matrix) -_sym_db.RegisterMessage(Document.Page.Layout) -_sym_db.RegisterMessage(Document.Page.Block) -_sym_db.RegisterMessage(Document.Page.Paragraph) -_sym_db.RegisterMessage(Document.Page.Line) -_sym_db.RegisterMessage(Document.Page.Token) -_sym_db.RegisterMessage(Document.Page.Token.DetectedBreak) -_sym_db.RegisterMessage(Document.Page.VisualElement) -_sym_db.RegisterMessage(Document.Page.Table) -_sym_db.RegisterMessage(Document.Page.Table.TableRow) -_sym_db.RegisterMessage(Document.Page.Table.TableCell) -_sym_db.RegisterMessage(Document.Page.FormField) -_sym_db.RegisterMessage(Document.Page.DetectedLanguage) -_sym_db.RegisterMessage(Document.Entity) -_sym_db.RegisterMessage(Document.Entity.NormalizedValue) -_sym_db.RegisterMessage(Document.EntityRelation) -_sym_db.RegisterMessage(Document.Translation) -_sym_db.RegisterMessage(Document.TextAnchor) -_sym_db.RegisterMessage(Document.TextAnchor.TextSegment) -_sym_db.RegisterMessage(Document.PageAnchor) -_sym_db.RegisterMessage(Document.PageAnchor.PageRef) -_sym_db.RegisterMessage(Document.Provenance) -_sym_db.RegisterMessage(Document.Provenance.Parent) -_sym_db.RegisterMessage(Document.Revision) -_sym_db.RegisterMessage(Document.Revision.HumanReview) -_sym_db.RegisterMessage(Document.TextChange) - - -DESCRIPTOR._options = None -_DOCUMENT_ENTITY_NORMALIZEDVALUE.fields_by_name["text"]._options = None -_DOCUMENT_ENTITY.fields_by_name["confidence"]._options = None -_DOCUMENT_ENTITY.fields_by_name["page_anchor"]._options = None -_DOCUMENT_ENTITY.fields_by_name["normalized_value"]._options = None -_DOCUMENT_ENTITY.fields_by_name["properties"]._options = None -_DOCUMENT_ENTITY.fields_by_name["provenance"]._options = None -_DOCUMENT_ENTITY.fields_by_name["redacted"]._options = None -_DOCUMENT_PAGEANCHOR_PAGEREF.fields_by_name["page"]._options = None -_DOCUMENT_PAGEANCHOR_PAGEREF.fields_by_name["layout_type"]._options = None -_DOCUMENT_PAGEANCHOR_PAGEREF.fields_by_name["layout_id"]._options = None -_DOCUMENT_PAGEANCHOR_PAGEREF.fields_by_name["bounding_poly"]._options = None -# @@protoc_insertion_point(module_scope) diff --git a/google/cloud/documentai_v1beta3/proto/document_pb2_grpc.py b/google/cloud/documentai_v1beta3/proto/document_pb2_grpc.py deleted file mode 100644 index 8a939394..00000000 --- a/google/cloud/documentai_v1beta3/proto/document_pb2_grpc.py +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc diff --git a/google/cloud/documentai_v1beta3/proto/document_processor_service_pb2.py b/google/cloud/documentai_v1beta3/proto/document_processor_service_pb2.py deleted file mode 100644 index 1ca7f93c..00000000 --- a/google/cloud/documentai_v1beta3/proto/document_processor_service_pb2.py +++ /dev/null @@ -1,1290 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai_v1beta3/proto/document_processor_service.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.documentai_v1beta3.proto import ( - document_pb2 as google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/documentai_v1beta3/proto/document_processor_service.proto", - package="google.cloud.documentai.v1beta3", - syntax="proto3", - serialized_options=b"\n#com.google.cloud.documentai.v1beta3B\032DocumentAiProcessorServiceP\001ZIgoogle.golang.org/genproto/googleapis/cloud/documentai/v1beta3;documentai\252\002\037Google.Cloud.DocumentAI.v1beta3\312\002\037Google\\Cloud\\DocumentAi\\v1beta3\352\002!Google::Cloud::DocumentAI::master\352AM\n\"documentai.googleapis.com/Location\022'projects/{project}/locations/{location}\352Ae\n#documentai.googleapis.com/Processor\022>projects/{project}/locations/{location}/processors/{processor}\352A\177\n+documentai.googleapis.com/HumanReviewConfig\022Pprojects/{project}/locations/{location}/processors/{processor}/humanReviewConfig", - create_key=_descriptor._internal_create_key, - serialized_pb=b'\nFgoogle/cloud/documentai_v1beta3/proto/document_processor_service.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x34google/cloud/documentai_v1beta3/proto/document.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto"\xa3\x01\n\x0eProcessRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\x12;\n\x08\x64ocument\x18\x02 \x01(\x0b\x32).google.cloud.documentai.v1beta3.Document\x12\x19\n\x11skip_human_review\x18\x03 \x01(\x08"n\n\x0fProcessResponse\x12;\n\x08\x64ocument\x18\x01 \x01(\x0b\x32).google.cloud.documentai.v1beta3.Document\x12\x1e\n\x16human_review_operation\x18\x02 \x01(\t"\xf6\x02\n\x13\x42\x61tchProcessRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#documentai.googleapis.com/Processor\x12\\\n\rinput_configs\x18\x02 \x03(\x0b\x32\x45.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig\x12]\n\routput_config\x18\x03 \x01(\x0b\x32\x46.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig\x1a\x39\n\x10\x42\x61tchInputConfig\x12\x12\n\ngcs_source\x18\x01 \x01(\t\x12\x11\n\tmime_type\x18\x02 \x01(\t\x1a,\n\x11\x42\x61tchOutputConfig\x12\x17\n\x0fgcs_destination\x18\x01 \x01(\t"\x16\n\x14\x42\x61tchProcessResponse"\xdd\x04\n\x14\x42\x61tchProcessMetadata\x12J\n\x05state\x18\x01 \x01(\x0e\x32;.google.cloud.documentai.v1beta3.BatchProcessMetadata.State\x12\x15\n\rstate_message\x18\x02 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12r\n\x1bindividual_process_statuses\x18\x05 \x03(\x0b\x32M.google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus\x1a\x97\x01\n\x17IndividualProcessStatus\x12\x18\n\x10input_gcs_source\x18\x01 \x01(\t\x12"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x1e\n\x16output_gcs_destination\x18\x03 \x01(\t\x12\x1e\n\x16human_review_operation\x18\x04 \x01(\t"r\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07WAITING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06"\xa6\x01\n\x15ReviewDocumentRequest\x12P\n\x13human_review_config\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+documentai.googleapis.com/HumanReviewConfig\x12;\n\x08\x64ocument\x18\x02 \x01(\x0b\x32).google.cloud.documentai.v1beta3.Document"1\n\x16ReviewDocumentResponse\x12\x17\n\x0fgcs_destination\x18\x01 \x01(\t"\xd8\x02\n\x1fReviewDocumentOperationMetadata\x12U\n\x05state\x18\x01 \x01(\x0e\x32\x46.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State\x12\x15\n\rstate_message\x18\x02 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\x0e\n\nCANCELLING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\r\n\tCANCELLED\x10\x05\x32\xd2\x06\n\x18\x44ocumentProcessorService\x12\xc3\x01\n\x0fProcessDocument\x12/.google.cloud.documentai.v1beta3.ProcessRequest\x1a\x30.google.cloud.documentai.v1beta3.ProcessResponse"M\x82\xd3\xe4\x93\x02@";/v1beta3/{name=projects/*/locations/*/processors/*}:process:\x01*\xda\x41\x04name\x12\xf0\x01\n\x15\x42\x61tchProcessDocuments\x12\x34.google.cloud.documentai.v1beta3.BatchProcessRequest\x1a\x1d.google.longrunning.Operation"\x81\x01\x82\xd3\xe4\x93\x02\x45"@/v1beta3/{name=projects/*/locations/*/processors/*}:batchProcess:\x01*\xda\x41\x04name\xca\x41,\n\x14\x42\x61tchProcessResponse\x12\x14\x42\x61tchProcessMetadata\x12\xaa\x02\n\x0eReviewDocument\x12\x36.google.cloud.documentai.v1beta3.ReviewDocumentRequest\x1a\x1d.google.longrunning.Operation"\xc0\x01\x82\xd3\xe4\x93\x02h"c/v1beta3/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument:\x01*\xda\x41\x13human_review_config\xca\x41\x39\n\x16ReviewDocumentResponse\x12\x1fReviewDocumentOperationMetadata\x1aP\xca\x41\x1cus-documentai.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xb0\x04\n#com.google.cloud.documentai.v1beta3B\x1a\x44ocumentAiProcessorServiceP\x01ZIgoogle.golang.org/genproto/googleapis/cloud/documentai/v1beta3;documentai\xaa\x02\x1fGoogle.Cloud.DocumentAI.v1beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAi\\v1beta3\xea\x02!Google::Cloud::DocumentAI::master\xea\x41M\n"documentai.googleapis.com/Location\x12\'projects/{project}/locations/{location}\xea\x41\x65\n#documentai.googleapis.com/Processor\x12>projects/{project}/locations/{location}/processors/{processor}\xea\x41\x7f\n+documentai.googleapis.com/HumanReviewConfig\x12Pprojects/{project}/locations/{location}/processors/{processor}/humanReviewConfigb\x06proto3', - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__pb2.DESCRIPTOR, - google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, - google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_rpc_dot_status__pb2.DESCRIPTOR, - ], -) - - -_BATCHPROCESSMETADATA_STATE = _descriptor.EnumDescriptor( - name="State", - full_name="google.cloud.documentai.v1beta3.BatchProcessMetadata.State", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="STATE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="WAITING", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="RUNNING", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="SUCCEEDED", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="CANCELLING", - index=4, - number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="CANCELLED", - index=5, - number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FAILED", - index=6, - number=6, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1576, - serialized_end=1690, -) -_sym_db.RegisterEnumDescriptor(_BATCHPROCESSMETADATA_STATE) - -_REVIEWDOCUMENTOPERATIONMETADATA_STATE = _descriptor.EnumDescriptor( - name="State", - full_name="google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="STATE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="RUNNING", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="CANCELLING", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="SUCCEEDED", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FAILED", - index=4, - number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="CANCELLED", - index=5, - number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2156, - serialized_end=2257, -) -_sym_db.RegisterEnumDescriptor(_REVIEWDOCUMENTOPERATIONMETADATA_STATE) - - -_PROCESSREQUEST = _descriptor.Descriptor( - name="ProcessRequest", - full_name="google.cloud.documentai.v1beta3.ProcessRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.documentai.v1beta3.ProcessRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\340A\002\372A%\n#documentai.googleapis.com/Processor", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="document", - full_name="google.cloud.documentai.v1beta3.ProcessRequest.document", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="skip_human_review", - full_name="google.cloud.documentai.v1beta3.ProcessRequest.skip_human_review", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=406, - serialized_end=569, -) - - -_PROCESSRESPONSE = _descriptor.Descriptor( - name="ProcessResponse", - full_name="google.cloud.documentai.v1beta3.ProcessResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="document", - full_name="google.cloud.documentai.v1beta3.ProcessResponse.document", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="human_review_operation", - full_name="google.cloud.documentai.v1beta3.ProcessResponse.human_review_operation", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=571, - serialized_end=681, -) - - -_BATCHPROCESSREQUEST_BATCHINPUTCONFIG = _descriptor.Descriptor( - name="BatchInputConfig", - full_name="google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_source", - full_name="google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig.gcs_source", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="mime_type", - full_name="google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig.mime_type", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=955, - serialized_end=1012, -) - -_BATCHPROCESSREQUEST_BATCHOUTPUTCONFIG = _descriptor.Descriptor( - name="BatchOutputConfig", - full_name="google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_destination", - full_name="google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig.gcs_destination", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1014, - serialized_end=1058, -) - -_BATCHPROCESSREQUEST = _descriptor.Descriptor( - name="BatchProcessRequest", - full_name="google.cloud.documentai.v1beta3.BatchProcessRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.documentai.v1beta3.BatchProcessRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\340A\002\372A%\n#documentai.googleapis.com/Processor", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="input_configs", - full_name="google.cloud.documentai.v1beta3.BatchProcessRequest.input_configs", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="output_config", - full_name="google.cloud.documentai.v1beta3.BatchProcessRequest.output_config", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[ - _BATCHPROCESSREQUEST_BATCHINPUTCONFIG, - _BATCHPROCESSREQUEST_BATCHOUTPUTCONFIG, - ], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=684, - serialized_end=1058, -) - - -_BATCHPROCESSRESPONSE = _descriptor.Descriptor( - name="BatchProcessResponse", - full_name="google.cloud.documentai.v1beta3.BatchProcessResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1060, - serialized_end=1082, -) - - -_BATCHPROCESSMETADATA_INDIVIDUALPROCESSSTATUS = _descriptor.Descriptor( - name="IndividualProcessStatus", - full_name="google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="input_gcs_source", - full_name="google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="status", - full_name="google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.status", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="output_gcs_destination", - full_name="google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.output_gcs_destination", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="human_review_operation", - full_name="google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.human_review_operation", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1423, - serialized_end=1574, -) - -_BATCHPROCESSMETADATA = _descriptor.Descriptor( - name="BatchProcessMetadata", - full_name="google.cloud.documentai.v1beta3.BatchProcessMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="state", - full_name="google.cloud.documentai.v1beta3.BatchProcessMetadata.state", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="state_message", - full_name="google.cloud.documentai.v1beta3.BatchProcessMetadata.state_message", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.documentai.v1beta3.BatchProcessMetadata.create_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="update_time", - full_name="google.cloud.documentai.v1beta3.BatchProcessMetadata.update_time", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="individual_process_statuses", - full_name="google.cloud.documentai.v1beta3.BatchProcessMetadata.individual_process_statuses", - index=4, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_BATCHPROCESSMETADATA_INDIVIDUALPROCESSSTATUS,], - enum_types=[_BATCHPROCESSMETADATA_STATE,], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1085, - serialized_end=1690, -) - - -_REVIEWDOCUMENTREQUEST = _descriptor.Descriptor( - name="ReviewDocumentRequest", - full_name="google.cloud.documentai.v1beta3.ReviewDocumentRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="human_review_config", - full_name="google.cloud.documentai.v1beta3.ReviewDocumentRequest.human_review_config", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\340A\002\372A-\n+documentai.googleapis.com/HumanReviewConfig", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="document", - full_name="google.cloud.documentai.v1beta3.ReviewDocumentRequest.document", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1693, - serialized_end=1859, -) - - -_REVIEWDOCUMENTRESPONSE = _descriptor.Descriptor( - name="ReviewDocumentResponse", - full_name="google.cloud.documentai.v1beta3.ReviewDocumentResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_destination", - full_name="google.cloud.documentai.v1beta3.ReviewDocumentResponse.gcs_destination", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1861, - serialized_end=1910, -) - - -_REVIEWDOCUMENTOPERATIONMETADATA = _descriptor.Descriptor( - name="ReviewDocumentOperationMetadata", - full_name="google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="state", - full_name="google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.state", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="state_message", - full_name="google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.state_message", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.create_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="update_time", - full_name="google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.update_time", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_REVIEWDOCUMENTOPERATIONMETADATA_STATE,], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1913, - serialized_end=2257, -) - -_PROCESSREQUEST.fields_by_name[ - "document" -].message_type = ( - google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__pb2._DOCUMENT -) -_PROCESSRESPONSE.fields_by_name[ - "document" -].message_type = ( - google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__pb2._DOCUMENT -) -_BATCHPROCESSREQUEST_BATCHINPUTCONFIG.containing_type = _BATCHPROCESSREQUEST -_BATCHPROCESSREQUEST_BATCHOUTPUTCONFIG.containing_type = _BATCHPROCESSREQUEST -_BATCHPROCESSREQUEST.fields_by_name[ - "input_configs" -].message_type = _BATCHPROCESSREQUEST_BATCHINPUTCONFIG -_BATCHPROCESSREQUEST.fields_by_name[ - "output_config" -].message_type = _BATCHPROCESSREQUEST_BATCHOUTPUTCONFIG -_BATCHPROCESSMETADATA_INDIVIDUALPROCESSSTATUS.fields_by_name[ - "status" -].message_type = google_dot_rpc_dot_status__pb2._STATUS -_BATCHPROCESSMETADATA_INDIVIDUALPROCESSSTATUS.containing_type = _BATCHPROCESSMETADATA -_BATCHPROCESSMETADATA.fields_by_name["state"].enum_type = _BATCHPROCESSMETADATA_STATE -_BATCHPROCESSMETADATA.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_BATCHPROCESSMETADATA.fields_by_name[ - "update_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_BATCHPROCESSMETADATA.fields_by_name[ - "individual_process_statuses" -].message_type = _BATCHPROCESSMETADATA_INDIVIDUALPROCESSSTATUS -_BATCHPROCESSMETADATA_STATE.containing_type = _BATCHPROCESSMETADATA -_REVIEWDOCUMENTREQUEST.fields_by_name[ - "document" -].message_type = ( - google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__pb2._DOCUMENT -) -_REVIEWDOCUMENTOPERATIONMETADATA.fields_by_name[ - "state" -].enum_type = _REVIEWDOCUMENTOPERATIONMETADATA_STATE -_REVIEWDOCUMENTOPERATIONMETADATA.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_REVIEWDOCUMENTOPERATIONMETADATA.fields_by_name[ - "update_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_REVIEWDOCUMENTOPERATIONMETADATA_STATE.containing_type = ( - _REVIEWDOCUMENTOPERATIONMETADATA -) -DESCRIPTOR.message_types_by_name["ProcessRequest"] = _PROCESSREQUEST -DESCRIPTOR.message_types_by_name["ProcessResponse"] = _PROCESSRESPONSE -DESCRIPTOR.message_types_by_name["BatchProcessRequest"] = _BATCHPROCESSREQUEST -DESCRIPTOR.message_types_by_name["BatchProcessResponse"] = _BATCHPROCESSRESPONSE -DESCRIPTOR.message_types_by_name["BatchProcessMetadata"] = _BATCHPROCESSMETADATA -DESCRIPTOR.message_types_by_name["ReviewDocumentRequest"] = _REVIEWDOCUMENTREQUEST -DESCRIPTOR.message_types_by_name["ReviewDocumentResponse"] = _REVIEWDOCUMENTRESPONSE -DESCRIPTOR.message_types_by_name[ - "ReviewDocumentOperationMetadata" -] = _REVIEWDOCUMENTOPERATIONMETADATA -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -ProcessRequest = _reflection.GeneratedProtocolMessageType( - "ProcessRequest", - (_message.Message,), - { - "DESCRIPTOR": _PROCESSREQUEST, - "__module__": "google.cloud.documentai_v1beta3.proto.document_processor_service_pb2", - "__doc__": """Request message for the process document method. - - Attributes: - name: - Required. The processor resource name. - document: - The document payload, the [content] and [mime_type] fields - must be set. - skip_human_review: - Whether Human Review feature should be skipped for this - request. Default to false. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.ProcessRequest) - }, -) -_sym_db.RegisterMessage(ProcessRequest) - -ProcessResponse = _reflection.GeneratedProtocolMessageType( - "ProcessResponse", - (_message.Message,), - { - "DESCRIPTOR": _PROCESSRESPONSE, - "__module__": "google.cloud.documentai_v1beta3.proto.document_processor_service_pb2", - "__doc__": """Response message for the process document method. - - Attributes: - document: - The document payload, will populate fields based on the - processor’s behavior. - human_review_operation: - The name of the operation triggered by the processed document. - If the human review process is not triggered, this field will - be empty. It has the same response type and metadata as the - long running operation returned by ReviewDocument method. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.ProcessResponse) - }, -) -_sym_db.RegisterMessage(ProcessResponse) - -BatchProcessRequest = _reflection.GeneratedProtocolMessageType( - "BatchProcessRequest", - (_message.Message,), - { - "BatchInputConfig": _reflection.GeneratedProtocolMessageType( - "BatchInputConfig", - (_message.Message,), - { - "DESCRIPTOR": _BATCHPROCESSREQUEST_BATCHINPUTCONFIG, - "__module__": "google.cloud.documentai_v1beta3.proto.document_processor_service_pb2", - "__doc__": """The message for input config in batch process. - - Attributes: - gcs_source: - The Cloud Storage location as the source of the document. - mime_type: - Mimetype of the input. If the input is a raw document, the - supported mimetypes are application/pdf, image/tiff, and - image/gif. If the input is a [Document] proto, the type should - be application/json. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig) - }, - ), - "BatchOutputConfig": _reflection.GeneratedProtocolMessageType( - "BatchOutputConfig", - (_message.Message,), - { - "DESCRIPTOR": _BATCHPROCESSREQUEST_BATCHOUTPUTCONFIG, - "__module__": "google.cloud.documentai_v1beta3.proto.document_processor_service_pb2", - "__doc__": """The message for output config in batch process. - - Attributes: - gcs_destination: - The output Cloud Storage directory to put the processed - documents. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig) - }, - ), - "DESCRIPTOR": _BATCHPROCESSREQUEST, - "__module__": "google.cloud.documentai_v1beta3.proto.document_processor_service_pb2", - "__doc__": """Request message for batch process document method. - - Attributes: - name: - Required. The processor resource name. - input_configs: - The input config for each single document in the batch - process. - output_config: - The overall output config for batch process. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.BatchProcessRequest) - }, -) -_sym_db.RegisterMessage(BatchProcessRequest) -_sym_db.RegisterMessage(BatchProcessRequest.BatchInputConfig) -_sym_db.RegisterMessage(BatchProcessRequest.BatchOutputConfig) - -BatchProcessResponse = _reflection.GeneratedProtocolMessageType( - "BatchProcessResponse", - (_message.Message,), - { - "DESCRIPTOR": _BATCHPROCESSRESPONSE, - "__module__": "google.cloud.documentai_v1beta3.proto.document_processor_service_pb2", - "__doc__": """Response message for batch process document method.""", - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.BatchProcessResponse) - }, -) -_sym_db.RegisterMessage(BatchProcessResponse) - -BatchProcessMetadata = _reflection.GeneratedProtocolMessageType( - "BatchProcessMetadata", - (_message.Message,), - { - "IndividualProcessStatus": _reflection.GeneratedProtocolMessageType( - "IndividualProcessStatus", - (_message.Message,), - { - "DESCRIPTOR": _BATCHPROCESSMETADATA_INDIVIDUALPROCESSSTATUS, - "__module__": "google.cloud.documentai_v1beta3.proto.document_processor_service_pb2", - "__doc__": """The status of a each individual document in the batch process. - - Attributes: - input_gcs_source: - The source of the document, same as the [input_gcs_source] - field in the request when the batch process started. The batch - process is started by take snapshot of that document, since a - user can move or change that document during the process. - status: - The status of the processing of the document. - output_gcs_destination: - The output_gcs_destination (in the request as - ‘output_gcs_destination’) of the processed document if it was - successful, otherwise empty. - human_review_operation: - The name of the operation triggered by the processed document. - If the human review process is not triggered, this field will - be empty. It has the same response type and metadata as the - long running operation returned by ReviewDocument method. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus) - }, - ), - "DESCRIPTOR": _BATCHPROCESSMETADATA, - "__module__": "google.cloud.documentai_v1beta3.proto.document_processor_service_pb2", - "__doc__": """The long running operation metadata for batch process method. - - Attributes: - state: - The state of the current batch processing. - state_message: - A message providing more details about the current state of - processing. For example, the error message if the operation is - failed. - create_time: - The creation time of the operation. - update_time: - The last update time of the operation. - individual_process_statuses: - The list of response details of each document. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.BatchProcessMetadata) - }, -) -_sym_db.RegisterMessage(BatchProcessMetadata) -_sym_db.RegisterMessage(BatchProcessMetadata.IndividualProcessStatus) - -ReviewDocumentRequest = _reflection.GeneratedProtocolMessageType( - "ReviewDocumentRequest", - (_message.Message,), - { - "DESCRIPTOR": _REVIEWDOCUMENTREQUEST, - "__module__": "google.cloud.documentai_v1beta3.proto.document_processor_service_pb2", - "__doc__": """Request message for review document method. - - Attributes: - human_review_config: - Required. The resource name of the HumanReviewConfig that the - document will be reviewed with. - document: - The document that needs human review. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.ReviewDocumentRequest) - }, -) -_sym_db.RegisterMessage(ReviewDocumentRequest) - -ReviewDocumentResponse = _reflection.GeneratedProtocolMessageType( - "ReviewDocumentResponse", - (_message.Message,), - { - "DESCRIPTOR": _REVIEWDOCUMENTRESPONSE, - "__module__": "google.cloud.documentai_v1beta3.proto.document_processor_service_pb2", - "__doc__": """Response message for review document method. - - Attributes: - gcs_destination: - The Cloud Storage uri for the human reviewed document. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.ReviewDocumentResponse) - }, -) -_sym_db.RegisterMessage(ReviewDocumentResponse) - -ReviewDocumentOperationMetadata = _reflection.GeneratedProtocolMessageType( - "ReviewDocumentOperationMetadata", - (_message.Message,), - { - "DESCRIPTOR": _REVIEWDOCUMENTOPERATIONMETADATA, - "__module__": "google.cloud.documentai_v1beta3.proto.document_processor_service_pb2", - "__doc__": """The long running operation metadata for review document method. - - Attributes: - state: - Used only when Operation.done is false. - state_message: - A message providing more details about the current state of - processing. For example, the error message if the operation is - failed. - create_time: - The creation time of the operation. - update_time: - The last update time of the operation. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata) - }, -) -_sym_db.RegisterMessage(ReviewDocumentOperationMetadata) - - -DESCRIPTOR._options = None -_PROCESSREQUEST.fields_by_name["name"]._options = None -_BATCHPROCESSREQUEST.fields_by_name["name"]._options = None -_REVIEWDOCUMENTREQUEST.fields_by_name["human_review_config"]._options = None - -_DOCUMENTPROCESSORSERVICE = _descriptor.ServiceDescriptor( - name="DocumentProcessorService", - full_name="google.cloud.documentai.v1beta3.DocumentProcessorService", - file=DESCRIPTOR, - index=0, - serialized_options=b"\312A\034us-documentai.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform", - create_key=_descriptor._internal_create_key, - serialized_start=2260, - serialized_end=3110, - methods=[ - _descriptor.MethodDescriptor( - name="ProcessDocument", - full_name="google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument", - index=0, - containing_service=None, - input_type=_PROCESSREQUEST, - output_type=_PROCESSRESPONSE, - serialized_options=b'\202\323\344\223\002@";/v1beta3/{name=projects/*/locations/*/processors/*}:process:\001*\332A\004name', - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="BatchProcessDocuments", - full_name="google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments", - index=1, - containing_service=None, - input_type=_BATCHPROCESSREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=b'\202\323\344\223\002E"@/v1beta3/{name=projects/*/locations/*/processors/*}:batchProcess:\001*\332A\004name\312A,\n\024BatchProcessResponse\022\024BatchProcessMetadata', - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ReviewDocument", - full_name="google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument", - index=2, - containing_service=None, - input_type=_REVIEWDOCUMENTREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=b'\202\323\344\223\002h"c/v1beta3/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument:\001*\332A\023human_review_config\312A9\n\026ReviewDocumentResponse\022\037ReviewDocumentOperationMetadata', - create_key=_descriptor._internal_create_key, - ), - ], -) -_sym_db.RegisterServiceDescriptor(_DOCUMENTPROCESSORSERVICE) - -DESCRIPTOR.services_by_name["DocumentProcessorService"] = _DOCUMENTPROCESSORSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/google/cloud/documentai_v1beta3/proto/document_processor_service_pb2_grpc.py b/google/cloud/documentai_v1beta3/proto/document_processor_service_pb2_grpc.py deleted file mode 100644 index c0bdf3a2..00000000 --- a/google/cloud/documentai_v1beta3/proto/document_processor_service_pb2_grpc.py +++ /dev/null @@ -1,185 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from google.cloud.documentai_v1beta3.proto import ( - document_processor_service_pb2 as google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) - - -class DocumentProcessorServiceStub(object): - """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. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ProcessDocument = channel.unary_unary( - "/google.cloud.documentai.v1beta3.DocumentProcessorService/ProcessDocument", - request_serializer=google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2.ProcessRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2.ProcessResponse.FromString, - ) - self.BatchProcessDocuments = channel.unary_unary( - "/google.cloud.documentai.v1beta3.DocumentProcessorService/BatchProcessDocuments", - request_serializer=google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2.BatchProcessRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.ReviewDocument = channel.unary_unary( - "/google.cloud.documentai.v1beta3.DocumentProcessorService/ReviewDocument", - request_serializer=google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2.ReviewDocumentRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - - -class DocumentProcessorServiceServicer(object): - """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. - """ - - def ProcessDocument(self, request, context): - """Processes a single document. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def BatchProcessDocuments(self, request, context): - """LRO endpoint to batch process many documents. The output is written - to Cloud Storage as JSON in the [Document] format. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ReviewDocument(self, request, context): - """Send a document for Human Review. The input document should be processed by - the specified processor. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_DocumentProcessorServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "ProcessDocument": grpc.unary_unary_rpc_method_handler( - servicer.ProcessDocument, - request_deserializer=google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2.ProcessRequest.FromString, - response_serializer=google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2.ProcessResponse.SerializeToString, - ), - "BatchProcessDocuments": grpc.unary_unary_rpc_method_handler( - servicer.BatchProcessDocuments, - request_deserializer=google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2.BatchProcessRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "ReviewDocument": grpc.unary_unary_rpc_method_handler( - servicer.ReviewDocument, - request_deserializer=google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2.ReviewDocumentRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.documentai.v1beta3.DocumentProcessorService", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) - - -# This class is part of an EXPERIMENTAL API. -class DocumentProcessorService(object): - """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. - """ - - @staticmethod - def ProcessDocument( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/google.cloud.documentai.v1beta3.DocumentProcessorService/ProcessDocument", - google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2.ProcessRequest.SerializeToString, - google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2.ProcessResponse.FromString, - options, - channel_credentials, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) - - @staticmethod - def BatchProcessDocuments( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/google.cloud.documentai.v1beta3.DocumentProcessorService/BatchProcessDocuments", - google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2.BatchProcessRequest.SerializeToString, - google_dot_longrunning_dot_operations__pb2.Operation.FromString, - options, - channel_credentials, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) - - @staticmethod - def ReviewDocument( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/google.cloud.documentai.v1beta3.DocumentProcessorService/ReviewDocument", - google_dot_cloud_dot_documentai__v1beta3_dot_proto_dot_document__processor__service__pb2.ReviewDocumentRequest.SerializeToString, - google_dot_longrunning_dot_operations__pb2.Operation.FromString, - options, - channel_credentials, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) diff --git a/google/cloud/documentai_v1beta3/proto/geometry_pb2.py b/google/cloud/documentai_v1beta3/proto/geometry_pb2.py deleted file mode 100644 index f4f61042..00000000 --- a/google/cloud/documentai_v1beta3/proto/geometry_pb2.py +++ /dev/null @@ -1,270 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai_v1beta3/proto/geometry.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/documentai_v1beta3/proto/geometry.proto", - package="google.cloud.documentai.v1beta3", - syntax="proto3", - serialized_options=b"\n#com.google.cloud.documentai.v1beta3B\rGeometryProtoP\001ZIgoogle.golang.org/genproto/googleapis/cloud/documentai/v1beta3;documentai\252\002\037Google.Cloud.DocumentAI.v1beta3\312\002\037Google\\Cloud\\DocumentAi\\v1beta3\352\002!Google::Cloud::DocumentAI::master", - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n4google/cloud/documentai_v1beta3/proto/geometry.proto\x12\x1fgoogle.cloud.documentai.v1beta3\x1a\x1cgoogle/api/annotations.proto"\x1e\n\x06Vertex\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05"(\n\x10NormalizedVertex\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02"\x99\x01\n\x0c\x42oundingPoly\x12\x39\n\x08vertices\x18\x01 \x03(\x0b\x32\'.google.cloud.documentai.v1beta3.Vertex\x12N\n\x13normalized_vertices\x18\x02 \x03(\x0b\x32\x31.google.cloud.documentai.v1beta3.NormalizedVertexB\xe9\x01\n#com.google.cloud.documentai.v1beta3B\rGeometryProtoP\x01ZIgoogle.golang.org/genproto/googleapis/cloud/documentai/v1beta3;documentai\xaa\x02\x1fGoogle.Cloud.DocumentAI.v1beta3\xca\x02\x1fGoogle\\Cloud\\DocumentAi\\v1beta3\xea\x02!Google::Cloud::DocumentAI::masterb\x06proto3', - dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR,], -) - - -_VERTEX = _descriptor.Descriptor( - name="Vertex", - full_name="google.cloud.documentai.v1beta3.Vertex", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="x", - full_name="google.cloud.documentai.v1beta3.Vertex.x", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="y", - full_name="google.cloud.documentai.v1beta3.Vertex.y", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=119, - serialized_end=149, -) - - -_NORMALIZEDVERTEX = _descriptor.Descriptor( - name="NormalizedVertex", - full_name="google.cloud.documentai.v1beta3.NormalizedVertex", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="x", - full_name="google.cloud.documentai.v1beta3.NormalizedVertex.x", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="y", - full_name="google.cloud.documentai.v1beta3.NormalizedVertex.y", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=151, - serialized_end=191, -) - - -_BOUNDINGPOLY = _descriptor.Descriptor( - name="BoundingPoly", - full_name="google.cloud.documentai.v1beta3.BoundingPoly", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="vertices", - full_name="google.cloud.documentai.v1beta3.BoundingPoly.vertices", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="normalized_vertices", - full_name="google.cloud.documentai.v1beta3.BoundingPoly.normalized_vertices", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=194, - serialized_end=347, -) - -_BOUNDINGPOLY.fields_by_name["vertices"].message_type = _VERTEX -_BOUNDINGPOLY.fields_by_name["normalized_vertices"].message_type = _NORMALIZEDVERTEX -DESCRIPTOR.message_types_by_name["Vertex"] = _VERTEX -DESCRIPTOR.message_types_by_name["NormalizedVertex"] = _NORMALIZEDVERTEX -DESCRIPTOR.message_types_by_name["BoundingPoly"] = _BOUNDINGPOLY -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Vertex = _reflection.GeneratedProtocolMessageType( - "Vertex", - (_message.Message,), - { - "DESCRIPTOR": _VERTEX, - "__module__": "google.cloud.documentai_v1beta3.proto.geometry_pb2", - "__doc__": """X coordinate. - - Attributes: - y: - Y coordinate. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Vertex) - }, -) -_sym_db.RegisterMessage(Vertex) - -NormalizedVertex = _reflection.GeneratedProtocolMessageType( - "NormalizedVertex", - (_message.Message,), - { - "DESCRIPTOR": _NORMALIZEDVERTEX, - "__module__": "google.cloud.documentai_v1beta3.proto.geometry_pb2", - "__doc__": """X coordinate. - - Attributes: - y: - Y coordinate. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.NormalizedVertex) - }, -) -_sym_db.RegisterMessage(NormalizedVertex) - -BoundingPoly = _reflection.GeneratedProtocolMessageType( - "BoundingPoly", - (_message.Message,), - { - "DESCRIPTOR": _BOUNDINGPOLY, - "__module__": "google.cloud.documentai_v1beta3.proto.geometry_pb2", - "__doc__": """A bounding polygon for the detected image annotation. - - Attributes: - vertices: - The bounding polygon vertices. - normalized_vertices: - The bounding polygon normalized vertices. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.BoundingPoly) - }, -) -_sym_db.RegisterMessage(BoundingPoly) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/google/cloud/documentai_v1beta3/proto/geometry_pb2_grpc.py b/google/cloud/documentai_v1beta3/proto/geometry_pb2_grpc.py deleted file mode 100644 index 8a939394..00000000 --- a/google/cloud/documentai_v1beta3/proto/geometry_pb2_grpc.py +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc diff --git a/synth.metadata b/synth.metadata index 45f9c253..8b70e913 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "git@github.com:googleapis/python-documentai", - "sha": "69e258f2aa09a485599259f3ceef3ad8c980b591" + "sha": "0547c2a7abe7fbf8e254f3f935ca7ec675ee20ac" } }, { From c6186ea7a58f83bc2e49d9df2a48fce3f78f0143 Mon Sep 17 00:00:00 2001 From: Bu Sun Kim Date: Wed, 18 Nov 2020 00:32:47 +0000 Subject: [PATCH 5/7] chore: cleanup test dir --- ...cument_processor_service_client_v1beta3.py | 215 ------------------ 1 file changed, 215 deletions(-) delete mode 100644 tests/unit/gapic/v1beta3/test_document_processor_service_client_v1beta3.py diff --git a/tests/unit/gapic/v1beta3/test_document_processor_service_client_v1beta3.py b/tests/unit/gapic/v1beta3/test_document_processor_service_client_v1beta3.py deleted file mode 100644 index 7fb1ebd9..00000000 --- a/tests/unit/gapic/v1beta3/test_document_processor_service_client_v1beta3.py +++ /dev/null @@ -1,215 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud.documentai import v1beta3 -from google.cloud.documentai.v1beta3.proto import document_processor_service_pb2 -from google.longrunning import operations_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestDocumentProcessorServiceClient(object): - def test_process_document(self): - # Setup Expected Response - human_review_operation = "humanReviewOperation2074827282" - expected_response = {"human_review_operation": human_review_operation} - expected_response = document_processor_service_pb2.ProcessResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = v1beta3.DocumentProcessorServiceClient() - - # Setup Request - name = client.processor_path("[PROJECT]", "[LOCATION]", "[PROCESSOR]") - - response = client.process_document(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = document_processor_service_pb2.ProcessRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_process_document_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = v1beta3.DocumentProcessorServiceClient() - - # Setup request - name = client.processor_path("[PROJECT]", "[LOCATION]", "[PROCESSOR]") - - with pytest.raises(CustomException): - client.process_document(name) - - def test_batch_process_documents(self): - # Setup Expected Response - expected_response = {} - expected_response = document_processor_service_pb2.BatchProcessResponse( - **expected_response - ) - operation = operations_pb2.Operation( - name="operations/test_batch_process_documents", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = v1beta3.DocumentProcessorServiceClient() - - # Setup Request - name = client.processor_path("[PROJECT]", "[LOCATION]", "[PROCESSOR]") - - response = client.batch_process_documents(name) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = document_processor_service_pb2.BatchProcessRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_batch_process_documents_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_batch_process_documents_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = v1beta3.DocumentProcessorServiceClient() - - # Setup Request - name = client.processor_path("[PROJECT]", "[LOCATION]", "[PROCESSOR]") - - response = client.batch_process_documents(name) - exception = response.exception() - assert exception.errors[0] == error - - def test_review_document(self): - # Setup Expected Response - gcs_destination = "gcsDestination714819302" - expected_response = {"gcs_destination": gcs_destination} - expected_response = document_processor_service_pb2.ReviewDocumentResponse( - **expected_response - ) - operation = operations_pb2.Operation( - name="operations/test_review_document", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = v1beta3.DocumentProcessorServiceClient() - - # Setup Request - human_review_config = client.human_review_config_path( - "[PROJECT]", "[LOCATION]", "[PROCESSOR]" - ) - - response = client.review_document(human_review_config) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = document_processor_service_pb2.ReviewDocumentRequest( - human_review_config=human_review_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_review_document_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_review_document_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = v1beta3.DocumentProcessorServiceClient() - - # Setup Request - human_review_config = client.human_review_config_path( - "[PROJECT]", "[LOCATION]", "[PROCESSOR]" - ) - - response = client.review_document(human_review_config) - exception = response.exception() - assert exception.errors[0] == error From 960f32fcbb516218216bed479c14cd69374d315e Mon Sep 17 00:00:00 2001 From: Bu Sun Kim Date: Wed, 18 Nov 2020 00:48:21 +0000 Subject: [PATCH 6/7] chore: regen --- synth.metadata | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synth.metadata b/synth.metadata index 8b70e913..8088f01c 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "git@github.com:googleapis/python-documentai", - "sha": "0547c2a7abe7fbf8e254f3f935ca7ec675ee20ac" + "sha": "c6186ea7a58f83bc2e49d9df2a48fce3f78f0143" } }, { From 6afac2ae882951c1c6b93105a72fa4ffc7c6eca3 Mon Sep 17 00:00:00 2001 From: Bu Sun Kim Date: Wed, 18 Nov 2020 00:52:30 +0000 Subject: [PATCH 7/7] chore: skip sample readmegen --- synth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synth.py b/synth.py index 3ae8445c..3281f52f 100644 --- a/synth.py +++ b/synth.py @@ -54,6 +54,6 @@ excludes=[".coveragerc"], # microgenerator has a good .coveragerc file ) -python.py_samples() +python.py_samples(skip_readmes=True) s.shell.run(["nox", "-s", "blacken"], hide_output=False)