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

Commit 530f2ba

Browse files
feat: add question_id field in ReviewDocumentOperationMetadata (#273)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 426180523 Source-Link: googleapis/googleapis@38a8eb9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/9a1a88b211e2e94bc8e35855378e0523cb8a6683 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOWExYTg4YjIxMWUyZTk0YmM4ZTM1ODU1Mzc4ZTA1MjNjYjhhNjY4MyJ9 chore: use gapic-generator-python 0.62.1 fix: resolve DuplicateCredentialArgs error when using credentials_file
1 parent 1c61b73 commit 530f2ba

File tree

46 files changed

+459
-472
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+459
-472
lines changed

google/cloud/documentai_v1/services/document_processor_service/async_client.py

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,9 @@ def sample_process_document():
245245
inline_document = documentai_v1.Document()
246246
inline_document.uri = "uri_value"
247247
248-
project = "my-project-id"
249-
location = "us-central1"
250-
processor = "processor_value"
251-
name = f"projects/{project}/locations/{location}/processors/{processor}"
252-
253248
request = documentai_v1.ProcessRequest(
254249
inline_document=inline_document,
255-
name=name,
250+
name="name_value",
256251
)
257252
258253
# Make the request
@@ -285,7 +280,7 @@ def sample_process_document():
285280
286281
"""
287282
# Create or coerce a protobuf request object.
288-
# Sanity check: If we got a request object, we should *not* have
283+
# Quick check: If we got a request object, we should *not* have
289284
# gotten any keyword arguments that map to the request.
290285
has_flattened_params = any([name])
291286
if request is not None and has_flattened_params:
@@ -353,13 +348,8 @@ def sample_batch_process_documents():
353348
client = documentai_v1.DocumentProcessorServiceClient()
354349
355350
# Initialize request argument(s)
356-
project = "my-project-id"
357-
location = "us-central1"
358-
processor = "processor_value"
359-
name = f"projects/{project}/locations/{location}/processors/{processor}"
360-
361351
request = documentai_v1.BatchProcessRequest(
362-
name=name,
352+
name="name_value",
363353
)
364354
365355
# Make the request
@@ -397,7 +387,7 @@ def sample_batch_process_documents():
397387
398388
"""
399389
# Create or coerce a protobuf request object.
400-
# Sanity check: If we got a request object, we should *not* have
390+
# Quick check: If we got a request object, we should *not* have
401391
# gotten any keyword arguments that map to the request.
402392
has_flattened_params = any([name])
403393
if request is not None and has_flattened_params:
@@ -476,14 +466,9 @@ def sample_review_document():
476466
inline_document = documentai_v1.Document()
477467
inline_document.uri = "uri_value"
478468
479-
project = "my-project-id"
480-
location = "us-central1"
481-
processor = "processor_value"
482-
human_review_config = f"projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig"
483-
484469
request = documentai_v1.ReviewDocumentRequest(
485470
inline_document=inline_document,
486-
human_review_config=human_review_config,
471+
human_review_config="human_review_config_value",
487472
)
488473
489474
# Make the request
@@ -522,7 +507,7 @@ def sample_review_document():
522507
523508
"""
524509
# Create or coerce a protobuf request object.
525-
# Sanity check: If we got a request object, we should *not* have
510+
# Quick check: If we got a request object, we should *not* have
526511
# gotten any keyword arguments that map to the request.
527512
has_flattened_params = any([human_review_config])
528513
if request is not None and has_flattened_params:

google/cloud/documentai_v1/services/document_processor_service/client.py

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -448,14 +448,9 @@ def sample_process_document():
448448
inline_document = documentai_v1.Document()
449449
inline_document.uri = "uri_value"
450450
451-
project = "my-project-id"
452-
location = "us-central1"
453-
processor = "processor_value"
454-
name = f"projects/{project}/locations/{location}/processors/{processor}"
455-
456451
request = documentai_v1.ProcessRequest(
457452
inline_document=inline_document,
458-
name=name,
453+
name="name_value",
459454
)
460455
461456
# Make the request
@@ -488,7 +483,7 @@ def sample_process_document():
488483
489484
"""
490485
# Create or coerce a protobuf request object.
491-
# Sanity check: If we got a request object, we should *not* have
486+
# Quick check: If we got a request object, we should *not* have
492487
# gotten any keyword arguments that map to the request.
493488
has_flattened_params = any([name])
494489
if request is not None and has_flattened_params:
@@ -547,13 +542,8 @@ def sample_batch_process_documents():
547542
client = documentai_v1.DocumentProcessorServiceClient()
548543
549544
# Initialize request argument(s)
550-
project = "my-project-id"
551-
location = "us-central1"
552-
processor = "processor_value"
553-
name = f"projects/{project}/locations/{location}/processors/{processor}"
554-
555545
request = documentai_v1.BatchProcessRequest(
556-
name=name,
546+
name="name_value",
557547
)
558548
559549
# Make the request
@@ -591,7 +581,7 @@ def sample_batch_process_documents():
591581
592582
"""
593583
# Create or coerce a protobuf request object.
594-
# Sanity check: If we got a request object, we should *not* have
584+
# Quick check: If we got a request object, we should *not* have
595585
# gotten any keyword arguments that map to the request.
596586
has_flattened_params = any([name])
597587
if request is not None and has_flattened_params:
@@ -661,14 +651,9 @@ def sample_review_document():
661651
inline_document = documentai_v1.Document()
662652
inline_document.uri = "uri_value"
663653
664-
project = "my-project-id"
665-
location = "us-central1"
666-
processor = "processor_value"
667-
human_review_config = f"projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig"
668-
669654
request = documentai_v1.ReviewDocumentRequest(
670655
inline_document=inline_document,
671-
human_review_config=human_review_config,
656+
human_review_config="human_review_config_value",
672657
)
673658
674659
# Make the request
@@ -707,7 +692,7 @@ def sample_review_document():
707692
708693
"""
709694
# Create or coerce a protobuf request object.
710-
# Sanity check: If we got a request object, we should *not* have
695+
# Quick check: If we got a request object, we should *not* have
711696
# gotten any keyword arguments that map to the request.
712697
has_flattened_params = any([human_review_config])
713698
if request is not None and has_flattened_params:

google/cloud/documentai_v1/services/document_processor_service/transports/grpc.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,11 @@ def __init__(
165165
if not self._grpc_channel:
166166
self._grpc_channel = type(self).create_channel(
167167
self._host,
168+
# use the credentials which are saved
168169
credentials=self._credentials,
169-
credentials_file=credentials_file,
170+
# Set ``credentials_file`` to ``None`` here as
171+
# the credentials that we saved earlier should be used.
172+
credentials_file=None,
170173
scopes=self._scopes,
171174
ssl_credentials=self._ssl_channel_credentials,
172175
quota_project_id=quota_project_id,
@@ -239,7 +242,7 @@ def operations_client(self) -> operations_v1.OperationsClient:
239242
This property caches on the instance; repeated calls return the same
240243
client.
241244
"""
242-
# Sanity check: Only create a new client if we do not already have one.
245+
# Quick check: Only create a new client if we do not already have one.
243246
if self._operations_client is None:
244247
self._operations_client = operations_v1.OperationsClient(self.grpc_channel)
245248

google/cloud/documentai_v1/services/document_processor_service/transports/grpc_asyncio.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,11 @@ def __init__(
210210
if not self._grpc_channel:
211211
self._grpc_channel = type(self).create_channel(
212212
self._host,
213+
# use the credentials which are saved
213214
credentials=self._credentials,
214-
credentials_file=credentials_file,
215+
# Set ``credentials_file`` to ``None`` here as
216+
# the credentials that we saved earlier should be used.
217+
credentials_file=None,
215218
scopes=self._scopes,
216219
ssl_credentials=self._ssl_channel_credentials,
217220
quota_project_id=quota_project_id,
@@ -241,7 +244,7 @@ def operations_client(self) -> operations_v1.OperationsAsyncClient:
241244
This property caches on the instance; repeated calls return the same
242245
client.
243246
"""
244-
# Sanity check: Only create a new client if we do not already have one.
247+
# Quick check: Only create a new client if we do not already have one.
245248
if self._operations_client is None:
246249
self._operations_client = operations_v1.OperationsAsyncClient(
247250
self.grpc_channel

google/cloud/documentai_v1/types/document.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ class Document(proto.Message):
6363
mime_type (str):
6464
An IANA published MIME type (also referred to
6565
as media type). For more information, see
66-
https://www.iana.org/assignments/media-
67-
types/media-types.xhtml.
66+
https://www.iana.org/assignments/media-types/media-types.xhtml.
6867
text (str):
6968
Optional. UTF-8 encoded text in reading order
7069
from the document.

google/cloud/documentai_v1beta2/services/document_understanding_service/async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ async def batch_process_documents(
254254
255255
"""
256256
# Create or coerce a protobuf request object.
257-
# Sanity check: If we got a request object, we should *not* have
257+
# Quick check: If we got a request object, we should *not* have
258258
# gotten any keyword arguments that map to the request.
259259
has_flattened_params = any([requests])
260260
if request is not None and has_flattened_params:

google/cloud/documentai_v1beta2/services/document_understanding_service/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ def batch_process_documents(
436436
437437
"""
438438
# Create or coerce a protobuf request object.
439-
# Sanity check: If we got a request object, we should *not* have
439+
# Quick check: If we got a request object, we should *not* have
440440
# gotten any keyword arguments that map to the request.
441441
has_flattened_params = any([requests])
442442
if request is not None and has_flattened_params:

google/cloud/documentai_v1beta2/services/document_understanding_service/transports/grpc.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,11 @@ def __init__(
164164
if not self._grpc_channel:
165165
self._grpc_channel = type(self).create_channel(
166166
self._host,
167+
# use the credentials which are saved
167168
credentials=self._credentials,
168-
credentials_file=credentials_file,
169+
# Set ``credentials_file`` to ``None`` here as
170+
# the credentials that we saved earlier should be used.
171+
credentials_file=None,
169172
scopes=self._scopes,
170173
ssl_credentials=self._ssl_channel_credentials,
171174
quota_project_id=quota_project_id,
@@ -238,7 +241,7 @@ def operations_client(self) -> operations_v1.OperationsClient:
238241
This property caches on the instance; repeated calls return the same
239242
client.
240243
"""
241-
# Sanity check: Only create a new client if we do not already have one.
244+
# Quick check: Only create a new client if we do not already have one.
242245
if self._operations_client is None:
243246
self._operations_client = operations_v1.OperationsClient(self.grpc_channel)
244247

google/cloud/documentai_v1beta2/services/document_understanding_service/transports/grpc_asyncio.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,11 @@ def __init__(
211211
if not self._grpc_channel:
212212
self._grpc_channel = type(self).create_channel(
213213
self._host,
214+
# use the credentials which are saved
214215
credentials=self._credentials,
215-
credentials_file=credentials_file,
216+
# Set ``credentials_file`` to ``None`` here as
217+
# the credentials that we saved earlier should be used.
218+
credentials_file=None,
216219
scopes=self._scopes,
217220
ssl_credentials=self._ssl_channel_credentials,
218221
quota_project_id=quota_project_id,
@@ -242,7 +245,7 @@ def operations_client(self) -> operations_v1.OperationsAsyncClient:
242245
This property caches on the instance; repeated calls return the same
243246
client.
244247
"""
245-
# Sanity check: Only create a new client if we do not already have one.
248+
# Quick check: Only create a new client if we do not already have one.
246249
if self._operations_client is None:
247250
self._operations_client = operations_v1.OperationsAsyncClient(
248251
self.grpc_channel

google/cloud/documentai_v1beta2/types/document.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ class Document(proto.Message):
5858
mime_type (str):
5959
An IANA published MIME type (also referred to
6060
as media type). For more information, see
61-
https://www.iana.org/assignments/media-
62-
types/media-types.xhtml.
61+
https://www.iana.org/assignments/media-types/media-types.xhtml.
6362
text (str):
6463
UTF-8 encoded text in reading order from the
6564
document.

0 commit comments

Comments
 (0)