Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
feat: add question_id field in ReviewDocumentOperationMetadata (#273)
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 426180523

Source-Link: googleapis/googleapis@38a8eb9

Source-Link: googleapis/googleapis-gen@9a1a88b
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOWExYTg4YjIxMWUyZTk0YmM4ZTM1ODU1Mzc4ZTA1MjNjYjhhNjY4MyJ9

chore: use gapic-generator-python 0.62.1
fix: resolve DuplicateCredentialArgs error when using credentials_file
  • Loading branch information
gcf-owl-bot[bot] committed Feb 3, 2022
1 parent 1c61b73 commit 530f2ba
Show file tree
Hide file tree
Showing 46 changed files with 459 additions and 472 deletions.
Expand Up @@ -245,14 +245,9 @@ def sample_process_document():
inline_document = documentai_v1.Document()
inline_document.uri = "uri_value"
project = "my-project-id"
location = "us-central1"
processor = "processor_value"
name = f"projects/{project}/locations/{location}/processors/{processor}"
request = documentai_v1.ProcessRequest(
inline_document=inline_document,
name=name,
name="name_value",
)
# Make the request
Expand Down Expand Up @@ -285,7 +280,7 @@ def sample_process_document():
"""
# Create or coerce a protobuf request object.
# Sanity check: If we got a request object, we should *not* have
# Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([name])
if request is not None and has_flattened_params:
Expand Down Expand Up @@ -353,13 +348,8 @@ def sample_batch_process_documents():
client = documentai_v1.DocumentProcessorServiceClient()
# Initialize request argument(s)
project = "my-project-id"
location = "us-central1"
processor = "processor_value"
name = f"projects/{project}/locations/{location}/processors/{processor}"
request = documentai_v1.BatchProcessRequest(
name=name,
name="name_value",
)
# Make the request
Expand Down Expand Up @@ -397,7 +387,7 @@ def sample_batch_process_documents():
"""
# Create or coerce a protobuf request object.
# Sanity check: If we got a request object, we should *not* have
# Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([name])
if request is not None and has_flattened_params:
Expand Down Expand Up @@ -476,14 +466,9 @@ def sample_review_document():
inline_document = documentai_v1.Document()
inline_document.uri = "uri_value"
project = "my-project-id"
location = "us-central1"
processor = "processor_value"
human_review_config = f"projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig"
request = documentai_v1.ReviewDocumentRequest(
inline_document=inline_document,
human_review_config=human_review_config,
human_review_config="human_review_config_value",
)
# Make the request
Expand Down Expand Up @@ -522,7 +507,7 @@ def sample_review_document():
"""
# Create or coerce a protobuf request object.
# Sanity check: If we got a request object, we should *not* have
# Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([human_review_config])
if request is not None and has_flattened_params:
Expand Down
Expand Up @@ -448,14 +448,9 @@ def sample_process_document():
inline_document = documentai_v1.Document()
inline_document.uri = "uri_value"
project = "my-project-id"
location = "us-central1"
processor = "processor_value"
name = f"projects/{project}/locations/{location}/processors/{processor}"
request = documentai_v1.ProcessRequest(
inline_document=inline_document,
name=name,
name="name_value",
)
# Make the request
Expand Down Expand Up @@ -488,7 +483,7 @@ def sample_process_document():
"""
# Create or coerce a protobuf request object.
# Sanity check: If we got a request object, we should *not* have
# Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([name])
if request is not None and has_flattened_params:
Expand Down Expand Up @@ -547,13 +542,8 @@ def sample_batch_process_documents():
client = documentai_v1.DocumentProcessorServiceClient()
# Initialize request argument(s)
project = "my-project-id"
location = "us-central1"
processor = "processor_value"
name = f"projects/{project}/locations/{location}/processors/{processor}"
request = documentai_v1.BatchProcessRequest(
name=name,
name="name_value",
)
# Make the request
Expand Down Expand Up @@ -591,7 +581,7 @@ def sample_batch_process_documents():
"""
# Create or coerce a protobuf request object.
# Sanity check: If we got a request object, we should *not* have
# Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([name])
if request is not None and has_flattened_params:
Expand Down Expand Up @@ -661,14 +651,9 @@ def sample_review_document():
inline_document = documentai_v1.Document()
inline_document.uri = "uri_value"
project = "my-project-id"
location = "us-central1"
processor = "processor_value"
human_review_config = f"projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig"
request = documentai_v1.ReviewDocumentRequest(
inline_document=inline_document,
human_review_config=human_review_config,
human_review_config="human_review_config_value",
)
# Make the request
Expand Down Expand Up @@ -707,7 +692,7 @@ def sample_review_document():
"""
# Create or coerce a protobuf request object.
# Sanity check: If we got a request object, we should *not* have
# Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([human_review_config])
if request is not None and has_flattened_params:
Expand Down
Expand Up @@ -165,8 +165,11 @@ def __init__(
if not self._grpc_channel:
self._grpc_channel = type(self).create_channel(
self._host,
# use the credentials which are saved
credentials=self._credentials,
credentials_file=credentials_file,
# Set ``credentials_file`` to ``None`` here as
# the credentials that we saved earlier should be used.
credentials_file=None,
scopes=self._scopes,
ssl_credentials=self._ssl_channel_credentials,
quota_project_id=quota_project_id,
Expand Down Expand Up @@ -239,7 +242,7 @@ def operations_client(self) -> operations_v1.OperationsClient:
This property caches on the instance; repeated calls return the same
client.
"""
# Sanity check: Only create a new client if we do not already have one.
# Quick check: Only create a new client if we do not already have one.
if self._operations_client is None:
self._operations_client = operations_v1.OperationsClient(self.grpc_channel)

Expand Down
Expand Up @@ -210,8 +210,11 @@ def __init__(
if not self._grpc_channel:
self._grpc_channel = type(self).create_channel(
self._host,
# use the credentials which are saved
credentials=self._credentials,
credentials_file=credentials_file,
# Set ``credentials_file`` to ``None`` here as
# the credentials that we saved earlier should be used.
credentials_file=None,
scopes=self._scopes,
ssl_credentials=self._ssl_channel_credentials,
quota_project_id=quota_project_id,
Expand Down Expand Up @@ -241,7 +244,7 @@ def operations_client(self) -> operations_v1.OperationsAsyncClient:
This property caches on the instance; repeated calls return the same
client.
"""
# Sanity check: Only create a new client if we do not already have one.
# Quick check: Only create a new client if we do not already have one.
if self._operations_client is None:
self._operations_client = operations_v1.OperationsAsyncClient(
self.grpc_channel
Expand Down
3 changes: 1 addition & 2 deletions google/cloud/documentai_v1/types/document.py
Expand Up @@ -63,8 +63,7 @@ class Document(proto.Message):
mime_type (str):
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.
https://www.iana.org/assignments/media-types/media-types.xhtml.
text (str):
Optional. UTF-8 encoded text in reading order
from the document.
Expand Down
Expand Up @@ -254,7 +254,7 @@ async def batch_process_documents(
"""
# Create or coerce a protobuf request object.
# Sanity check: If we got a request object, we should *not* have
# Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([requests])
if request is not None and has_flattened_params:
Expand Down
Expand Up @@ -436,7 +436,7 @@ def batch_process_documents(
"""
# Create or coerce a protobuf request object.
# Sanity check: If we got a request object, we should *not* have
# Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([requests])
if request is not None and has_flattened_params:
Expand Down
Expand Up @@ -164,8 +164,11 @@ def __init__(
if not self._grpc_channel:
self._grpc_channel = type(self).create_channel(
self._host,
# use the credentials which are saved
credentials=self._credentials,
credentials_file=credentials_file,
# Set ``credentials_file`` to ``None`` here as
# the credentials that we saved earlier should be used.
credentials_file=None,
scopes=self._scopes,
ssl_credentials=self._ssl_channel_credentials,
quota_project_id=quota_project_id,
Expand Down Expand Up @@ -238,7 +241,7 @@ def operations_client(self) -> operations_v1.OperationsClient:
This property caches on the instance; repeated calls return the same
client.
"""
# Sanity check: Only create a new client if we do not already have one.
# Quick check: Only create a new client if we do not already have one.
if self._operations_client is None:
self._operations_client = operations_v1.OperationsClient(self.grpc_channel)

Expand Down
Expand Up @@ -211,8 +211,11 @@ def __init__(
if not self._grpc_channel:
self._grpc_channel = type(self).create_channel(
self._host,
# use the credentials which are saved
credentials=self._credentials,
credentials_file=credentials_file,
# Set ``credentials_file`` to ``None`` here as
# the credentials that we saved earlier should be used.
credentials_file=None,
scopes=self._scopes,
ssl_credentials=self._ssl_channel_credentials,
quota_project_id=quota_project_id,
Expand Down Expand Up @@ -242,7 +245,7 @@ def operations_client(self) -> operations_v1.OperationsAsyncClient:
This property caches on the instance; repeated calls return the same
client.
"""
# Sanity check: Only create a new client if we do not already have one.
# Quick check: Only create a new client if we do not already have one.
if self._operations_client is None:
self._operations_client = operations_v1.OperationsAsyncClient(
self.grpc_channel
Expand Down
3 changes: 1 addition & 2 deletions google/cloud/documentai_v1beta2/types/document.py
Expand Up @@ -58,8 +58,7 @@ class Document(proto.Message):
mime_type (str):
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.
https://www.iana.org/assignments/media-types/media-types.xhtml.
text (str):
UTF-8 encoded text in reading order from the
document.
Expand Down

0 comments on commit 530f2ba

Please sign in to comment.