Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@
from typing import Dict, Sequence, Tuple, Type, Union
import pkg_resources

from google.api_core.client_options import ClientOptions # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.api_core.client_options import ClientOptions
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]
try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
except AttributeError: # pragma: NO COVER
OptionalRetry = Union[retries.Retry, object] # type: ignore

from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,25 @@
# limitations under the License.
#
from collections import OrderedDict
from distutils import util
import os
import re
from typing import Dict, Optional, Sequence, Tuple, Type, Union
import pkg_resources

from google.api_core import client_options as client_options_lib # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.api_core import client_options as client_options_lib
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport import mtls # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.auth.exceptions import MutualTLSChannelError # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]
try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
except AttributeError: # pragma: NO COVER
OptionalRetry = Union[retries.Retry, object] # type: ignore

from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
Expand Down Expand Up @@ -308,8 +310,15 @@ def __init__(
client_options = client_options_lib.ClientOptions()

# Create SSL credentials for mutual TLS if needed.
use_client_cert = bool(
util.strtobool(os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false"))
if os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") not in (
"true",
"false",
):
raise ValueError(
"Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`"
)
use_client_cert = (
os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true"
)

client_cert_source_func = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
import pkg_resources

import google.auth # type: ignore
import google.api_core # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.api_core import operations_v1 # type: ignore
import google.api_core
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.api_core import operations_v1
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
import warnings
from typing import Callable, Dict, Optional, Sequence, Tuple, Union

from google.api_core import grpc_helpers # type: ignore
from google.api_core import operations_v1 # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import grpc_helpers
from google.api_core import operations_v1
from google.api_core import gapic_v1
import google.auth # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
import warnings
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union

from google.api_core import gapic_v1 # type: ignore
from google.api_core import grpc_helpers_async # type: ignore
from google.api_core import operations_v1 # type: ignore
from google.api_core import gapic_v1
from google.api_core import grpc_helpers_async
from google.api_core import operations_v1
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore

Expand Down
9 changes: 9 additions & 0 deletions google/cloud/documentai_v1/types/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@ class Document(proto.Message):
not supported. See `Google Cloud Storage Request
URIs <https://cloud.google.com/storage/docs/reference-uris>`__
for more info.

This field is a member of `oneof`_ ``source``.
content (bytes):
Optional. 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.

This field is a member of `oneof`_ ``source``.
mime_type (str):
An IANA published MIME type (also referred to
Expand Down Expand Up @@ -703,24 +705,29 @@ class NormalizedValue(proto.Message):
money_value (google.type.money_pb2.Money):
Money value. See also:
https://github.com/googleapis/googleapis/blob/master/google/type/money.proto

This field is a member of `oneof`_ ``structured_value``.
date_value (google.type.date_pb2.Date):
Date value. Includes year, month, day. See
also:
https://github.com/googleapis/googleapis/blob/master/google/type/date.proto

This field is a member of `oneof`_ ``structured_value``.
datetime_value (google.type.datetime_pb2.DateTime):
DateTime value. Includes date, time, and
timezone. See also:
https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto

This field is a member of `oneof`_ ``structured_value``.
address_value (google.type.postal_address_pb2.PostalAddress):
Postal address. See also:
https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto

This field is a member of `oneof`_ ``structured_value``.
boolean_value (bool):
Boolean value. Can be used for entities with
binary values, or for checkboxes.

This field is a member of `oneof`_ ``structured_value``.
text (str):
Required. Normalized entity value stored as a string. This
Expand Down Expand Up @@ -979,10 +986,12 @@ class Revision(proto.Message):
agent (str):
If the change was made by a person specify
the name or id of that person.

This field is a member of `oneof`_ ``source``.
processor (str):
If the annotation was made by processor
identify the processor by its resource name.

This field is a member of `oneof`_ ``source``.
id (str):
Id of the revision. Unique within the
Expand Down
3 changes: 3 additions & 0 deletions google/cloud/documentai_v1/types/document_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,12 @@ class BatchDocumentsInputConfig(proto.Message):
gcs_prefix (google.cloud.documentai_v1.types.GcsPrefix):
The set of documents that match the specified Cloud Storage
[gcs_prefix].

This field is a member of `oneof`_ ``source``.
gcs_documents (google.cloud.documentai_v1.types.GcsDocuments):
The set of documents individually specified
on Cloud Storage.

This field is a member of `oneof`_ ``source``.
"""

Expand All @@ -122,6 +124,7 @@ class DocumentOutputConfig(proto.Message):
gcs_output_config (google.cloud.documentai_v1.types.DocumentOutputConfig.GcsOutputConfig):
Output config to write the results to Cloud
Storage.

This field is a member of `oneof`_ ``destination``.
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ class ProcessRequest(proto.Message):
Attributes:
inline_document (google.cloud.documentai_v1.types.Document):
An inline document proto.

This field is a member of `oneof`_ ``source``.
raw_document (google.cloud.documentai_v1.types.RawDocument):
A raw document content (bytes).

This field is a member of `oneof`_ ``source``.
name (str):
Required. The processor resource name.
Expand Down Expand Up @@ -226,6 +228,7 @@ class ReviewDocumentRequest(proto.Message):
Attributes:
inline_document (google.cloud.documentai_v1.types.Document):
An inline document proto.

This field is a member of `oneof`_ ``source``.
human_review_config (str):
Required. The resource name of the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@
from typing import Dict, Sequence, Tuple, Type, Union
import pkg_resources

from google.api_core.client_options import ClientOptions # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.api_core.client_options import ClientOptions
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]
try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
except AttributeError: # pragma: NO COVER
OptionalRetry = Union[retries.Retry, object] # type: ignore

from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,25 @@
# limitations under the License.
#
from collections import OrderedDict
from distutils import util
import os
import re
from typing import Dict, Optional, Sequence, Tuple, Type, Union
import pkg_resources

from google.api_core import client_options as client_options_lib # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.api_core import client_options as client_options_lib
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport import mtls # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.auth.exceptions import MutualTLSChannelError # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]
try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
except AttributeError: # pragma: NO COVER
OptionalRetry = Union[retries.Retry, object] # type: ignore

from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
Expand Down Expand Up @@ -279,8 +281,15 @@ def __init__(
client_options = client_options_lib.ClientOptions()

# Create SSL credentials for mutual TLS if needed.
use_client_cert = bool(
util.strtobool(os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false"))
if os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") not in (
"true",
"false",
):
raise ValueError(
"Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`"
)
use_client_cert = (
os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true"
)

client_cert_source_func = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
import pkg_resources

import google.auth # type: ignore
import google.api_core # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.api_core import operations_v1 # type: ignore
import google.api_core
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.api_core import operations_v1
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
import warnings
from typing import Callable, Dict, Optional, Sequence, Tuple, Union

from google.api_core import grpc_helpers # type: ignore
from google.api_core import operations_v1 # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import grpc_helpers
from google.api_core import operations_v1
from google.api_core import gapic_v1
import google.auth # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
import warnings
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union

from google.api_core import gapic_v1 # type: ignore
from google.api_core import grpc_helpers_async # type: ignore
from google.api_core import operations_v1 # type: ignore
from google.api_core import gapic_v1
from google.api_core import grpc_helpers_async
from google.api_core import operations_v1
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore

Expand Down
3 changes: 3 additions & 0 deletions google/cloud/documentai_v1beta2/types/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ class Document(proto.Message):
supported. See `Google Cloud Storage Request
URIs <https://cloud.google.com/storage/docs/reference-uris>`__
for more info.

This field is a member of `oneof`_ ``source``.
content (bytes):
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.

This field is a member of `oneof`_ ``source``.
mime_type (str):
An IANA published MIME type (also referred to
Expand Down Expand Up @@ -126,6 +128,7 @@ class Label(proto.Message):

Format:
``projects/{project-id}/locations/{location-id}/models/{model-id}``

This field is a member of `oneof`_ ``source``.
name (str):
Name of the label.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ class InputConfig(proto.Message):
gcs_source (google.cloud.documentai_v1beta2.types.GcsSource):
The Google Cloud Storage location to read the
input from. This must be a single file.

This field is a member of `oneof`_ ``source``.
contents (bytes):
Content in bytes, represented as a stream of bytes. Note: As
Expand All @@ -334,6 +335,7 @@ class InputConfig(proto.Message):

This field only works for synchronous ProcessDocument
method.

This field is a member of `oneof`_ ``source``.
mime_type (str):
Required. Mimetype of the input. Current supported mimetypes
Expand All @@ -360,6 +362,7 @@ class OutputConfig(proto.Message):
gcs_destination (google.cloud.documentai_v1beta2.types.GcsDestination):
The Google Cloud Storage location to write
the output to.

This field is a member of `oneof`_ ``destination``.
pages_per_shard (int):
The max number of pages to include into each output Document
Expand Down
Loading