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

Commit a95fac8

Browse files
chore: use gapic-generator-python 0.51.2 (#216)
- [ ] Regenerate this pull request now. fix: add 'dict' annotation type to 'request' Committer: @busunkim96 PiperOrigin-RevId: 398509016 Source-Link: googleapis/googleapis@b224dfa Source-Link: https://github.com/googleapis/googleapis-gen/commit/63a1db7a38d74b9639592f521ed1daaf7299ad9a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjNhMWRiN2EzOGQ3NGI5NjM5NTkyZjUyMWVkMWRhYWY3Mjk5YWQ5YSJ9
1 parent b881185 commit a95fac8

12 files changed

Lines changed: 56 additions & 52 deletions

File tree

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from distutils import util
1818
import os
1919
import re
20-
from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union
20+
from typing import Dict, Optional, Sequence, Tuple, Type, Union
2121
import pkg_resources
2222

2323
from google.api_core import client_options as client_options_lib # type: ignore
@@ -377,7 +377,7 @@ def __init__(
377377

378378
def process_document(
379379
self,
380-
request: document_processor_service.ProcessRequest = None,
380+
request: Union[document_processor_service.ProcessRequest, dict] = None,
381381
*,
382382
name: str = None,
383383
retry: retries.Retry = gapic_v1.method.DEFAULT,
@@ -387,7 +387,7 @@ def process_document(
387387
r"""Processes a single document.
388388
389389
Args:
390-
request (google.cloud.documentai_v1.types.ProcessRequest):
390+
request (Union[google.cloud.documentai_v1.types.ProcessRequest, dict]):
391391
The request object. Request message for the process
392392
document method.
393393
name (str):
@@ -448,7 +448,7 @@ def process_document(
448448

449449
def batch_process_documents(
450450
self,
451-
request: document_processor_service.BatchProcessRequest = None,
451+
request: Union[document_processor_service.BatchProcessRequest, dict] = None,
452452
*,
453453
name: str = None,
454454
retry: retries.Retry = gapic_v1.method.DEFAULT,
@@ -459,7 +459,7 @@ def batch_process_documents(
459459
written to Cloud Storage as JSON in the [Document] format.
460460
461461
Args:
462-
request (google.cloud.documentai_v1.types.BatchProcessRequest):
462+
request (Union[google.cloud.documentai_v1.types.BatchProcessRequest, dict]):
463463
The request object. Request message for batch process
464464
document method.
465465
name (str):
@@ -531,7 +531,7 @@ def batch_process_documents(
531531

532532
def review_document(
533533
self,
534-
request: document_processor_service.ReviewDocumentRequest = None,
534+
request: Union[document_processor_service.ReviewDocumentRequest, dict] = None,
535535
*,
536536
human_review_config: str = None,
537537
retry: retries.Retry = gapic_v1.method.DEFAULT,
@@ -542,7 +542,7 @@ def review_document(
542542
should be processed by the specified processor.
543543
544544
Args:
545-
request (google.cloud.documentai_v1.types.ReviewDocumentRequest):
545+
request (Union[google.cloud.documentai_v1.types.ReviewDocumentRequest, dict]):
546546
The request object. Request message for review document
547547
method.
548548
human_review_config (str):

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def __init__(
119119
**scopes_kwargs, quota_project_id=quota_project_id
120120
)
121121

122-
# If the credentials is service account credentials, then always try to use self signed JWT.
122+
# If the credentials are service account credentials, then always try to use self signed JWT.
123123
if (
124124
always_use_jwt_access
125125
and isinstance(credentials, service_account.Credentials)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,16 @@ def __init__(
8686
api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint.
8787
If provided, it overrides the ``host`` argument and tries to create
8888
a mutual TLS channel with client SSL credentials from
89-
``client_cert_source`` or applicatin default SSL credentials.
89+
``client_cert_source`` or application default SSL credentials.
9090
client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]):
9191
Deprecated. A callback to provide client SSL certificate bytes and
9292
private key bytes, both in PEM format. It is ignored if
9393
``api_mtls_endpoint`` is None.
9494
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
95-
for grpc channel. It is ignored if ``channel`` is provided.
95+
for the grpc channel. It is ignored if ``channel`` is provided.
9696
client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
9797
A callback to provide client certificate bytes and private key bytes,
98-
both in PEM format. It is used to configure mutual TLS channel. It is
98+
both in PEM format. It is used to configure a mutual TLS channel. It is
9999
ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
100100
quota_project_id (Optional[str]): An optional project to use for billing
101101
and quota.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,16 @@ def __init__(
133133
api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint.
134134
If provided, it overrides the ``host`` argument and tries to create
135135
a mutual TLS channel with client SSL credentials from
136-
``client_cert_source`` or applicatin default SSL credentials.
136+
``client_cert_source`` or application default SSL credentials.
137137
client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]):
138138
Deprecated. A callback to provide client SSL certificate bytes and
139139
private key bytes, both in PEM format. It is ignored if
140140
``api_mtls_endpoint`` is None.
141141
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
142-
for grpc channel. It is ignored if ``channel`` is provided.
142+
for the grpc channel. It is ignored if ``channel`` is provided.
143143
client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
144144
A callback to provide client certificate bytes and private key bytes,
145-
both in PEM format. It is used to configure mutual TLS channel. It is
145+
both in PEM format. It is used to configure a mutual TLS channel. It is
146146
ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
147147
quota_project_id (Optional[str]): An optional project to use for billing
148148
and quota.

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from distutils import util
1818
import os
1919
import re
20-
from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union
20+
from typing import Dict, Optional, Sequence, Tuple, Type, Union
2121
import pkg_resources
2222

2323
from google.api_core import client_options as client_options_lib # type: ignore
@@ -348,7 +348,9 @@ def __init__(
348348

349349
def batch_process_documents(
350350
self,
351-
request: document_understanding.BatchProcessDocumentsRequest = None,
351+
request: Union[
352+
document_understanding.BatchProcessDocumentsRequest, dict
353+
] = None,
352354
*,
353355
requests: Sequence[document_understanding.ProcessDocumentRequest] = None,
354356
retry: retries.Retry = gapic_v1.method.DEFAULT,
@@ -359,7 +361,7 @@ def batch_process_documents(
359361
written to Cloud Storage as JSON in the [Document] format.
360362
361363
Args:
362-
request (google.cloud.documentai_v1beta2.types.BatchProcessDocumentsRequest):
364+
request (Union[google.cloud.documentai_v1beta2.types.BatchProcessDocumentsRequest, dict]):
363365
The request object. Request to batch process documents
364366
as an asynchronous operation. The output is written to
365367
Cloud Storage as JSON in the [Document] format.
@@ -431,7 +433,7 @@ def batch_process_documents(
431433

432434
def process_document(
433435
self,
434-
request: document_understanding.ProcessDocumentRequest = None,
436+
request: Union[document_understanding.ProcessDocumentRequest, dict] = None,
435437
*,
436438
retry: retries.Retry = gapic_v1.method.DEFAULT,
437439
timeout: float = None,
@@ -440,7 +442,7 @@ def process_document(
440442
r"""Processes a single document.
441443
442444
Args:
443-
request (google.cloud.documentai_v1beta2.types.ProcessDocumentRequest):
445+
request (Union[google.cloud.documentai_v1beta2.types.ProcessDocumentRequest, dict]):
444446
The request object. Request to process one document.
445447
retry (google.api_core.retry.Retry): Designation of what errors, if any,
446448
should be retried.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def __init__(
120120
**scopes_kwargs, quota_project_id=quota_project_id
121121
)
122122

123-
# If the credentials is service account credentials, then always try to use self signed JWT.
123+
# If the credentials are service account credentials, then always try to use self signed JWT.
124124
if (
125125
always_use_jwt_access
126126
and isinstance(credentials, service_account.Credentials)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,16 @@ def __init__(
8585
api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint.
8686
If provided, it overrides the ``host`` argument and tries to create
8787
a mutual TLS channel with client SSL credentials from
88-
``client_cert_source`` or applicatin default SSL credentials.
88+
``client_cert_source`` or application default SSL credentials.
8989
client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]):
9090
Deprecated. A callback to provide client SSL certificate bytes and
9191
private key bytes, both in PEM format. It is ignored if
9292
``api_mtls_endpoint`` is None.
9393
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
94-
for grpc channel. It is ignored if ``channel`` is provided.
94+
for the grpc channel. It is ignored if ``channel`` is provided.
9595
client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
9696
A callback to provide client certificate bytes and private key bytes,
97-
both in PEM format. It is used to configure mutual TLS channel. It is
97+
both in PEM format. It is used to configure a mutual TLS channel. It is
9898
ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
9999
quota_project_id (Optional[str]): An optional project to use for billing
100100
and quota.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,16 @@ def __init__(
134134
api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint.
135135
If provided, it overrides the ``host`` argument and tries to create
136136
a mutual TLS channel with client SSL credentials from
137-
``client_cert_source`` or applicatin default SSL credentials.
137+
``client_cert_source`` or application default SSL credentials.
138138
client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]):
139139
Deprecated. A callback to provide client SSL certificate bytes and
140140
private key bytes, both in PEM format. It is ignored if
141141
``api_mtls_endpoint`` is None.
142142
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
143-
for grpc channel. It is ignored if ``channel`` is provided.
143+
for the grpc channel. It is ignored if ``channel`` is provided.
144144
client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
145145
A callback to provide client certificate bytes and private key bytes,
146-
both in PEM format. It is used to configure mutual TLS channel. It is
146+
both in PEM format. It is used to configure a mutual TLS channel. It is
147147
ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
148148
quota_project_id (Optional[str]): An optional project to use for billing
149149
and quota.

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

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from distutils import util
1818
import os
1919
import re
20-
from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union
20+
from typing import Dict, Optional, Sequence, Tuple, Type, Union
2121
import pkg_resources
2222

2323
from google.api_core import client_options as client_options_lib # type: ignore
@@ -399,7 +399,7 @@ def __init__(
399399

400400
def process_document(
401401
self,
402-
request: document_processor_service.ProcessRequest = None,
402+
request: Union[document_processor_service.ProcessRequest, dict] = None,
403403
*,
404404
name: str = None,
405405
retry: retries.Retry = gapic_v1.method.DEFAULT,
@@ -409,7 +409,7 @@ def process_document(
409409
r"""Processes a single document.
410410
411411
Args:
412-
request (google.cloud.documentai_v1beta3.types.ProcessRequest):
412+
request (Union[google.cloud.documentai_v1beta3.types.ProcessRequest, dict]):
413413
The request object. Request message for the process
414414
document method.
415415
name (str):
@@ -470,7 +470,7 @@ def process_document(
470470

471471
def batch_process_documents(
472472
self,
473-
request: document_processor_service.BatchProcessRequest = None,
473+
request: Union[document_processor_service.BatchProcessRequest, dict] = None,
474474
*,
475475
name: str = None,
476476
retry: retries.Retry = gapic_v1.method.DEFAULT,
@@ -481,7 +481,7 @@ def batch_process_documents(
481481
written to Cloud Storage as JSON in the [Document] format.
482482
483483
Args:
484-
request (google.cloud.documentai_v1beta3.types.BatchProcessRequest):
484+
request (Union[google.cloud.documentai_v1beta3.types.BatchProcessRequest, dict]):
485485
The request object. Request message for batch process
486486
document method.
487487
name (str):
@@ -553,7 +553,9 @@ def batch_process_documents(
553553

554554
def fetch_processor_types(
555555
self,
556-
request: document_processor_service.FetchProcessorTypesRequest = None,
556+
request: Union[
557+
document_processor_service.FetchProcessorTypesRequest, dict
558+
] = None,
557559
*,
558560
parent: str = None,
559561
retry: retries.Retry = gapic_v1.method.DEFAULT,
@@ -563,7 +565,7 @@ def fetch_processor_types(
563565
r"""Fetches processor types.
564566
565567
Args:
566-
request (google.cloud.documentai_v1beta3.types.FetchProcessorTypesRequest):
568+
request (Union[google.cloud.documentai_v1beta3.types.FetchProcessorTypesRequest, dict]):
567569
The request object. Request message for fetch processor
568570
types.
569571
parent (str):
@@ -627,7 +629,7 @@ def fetch_processor_types(
627629

628630
def list_processors(
629631
self,
630-
request: document_processor_service.ListProcessorsRequest = None,
632+
request: Union[document_processor_service.ListProcessorsRequest, dict] = None,
631633
*,
632634
parent: str = None,
633635
retry: retries.Retry = gapic_v1.method.DEFAULT,
@@ -637,7 +639,7 @@ def list_processors(
637639
r"""Lists all processors which belong to this project.
638640
639641
Args:
640-
request (google.cloud.documentai_v1beta3.types.ListProcessorsRequest):
642+
request (Union[google.cloud.documentai_v1beta3.types.ListProcessorsRequest, dict]):
641643
The request object. Request message for list all
642644
processors belongs to a project.
643645
parent (str):
@@ -708,7 +710,7 @@ def list_processors(
708710

709711
def create_processor(
710712
self,
711-
request: document_processor_service.CreateProcessorRequest = None,
713+
request: Union[document_processor_service.CreateProcessorRequest, dict] = None,
712714
*,
713715
parent: str = None,
714716
processor: gcd_processor.Processor = None,
@@ -721,7 +723,7 @@ def create_processor(
721723
default after its creation.
722724
723725
Args:
724-
request (google.cloud.documentai_v1beta3.types.CreateProcessorRequest):
726+
request (Union[google.cloud.documentai_v1beta3.types.CreateProcessorRequest, dict]):
725727
The request object. Request message for create a
726728
processor. Notice this request is sent to a regionalized
727729
backend service, and if the processor type is not
@@ -798,7 +800,7 @@ def create_processor(
798800

799801
def delete_processor(
800802
self,
801-
request: document_processor_service.DeleteProcessorRequest = None,
803+
request: Union[document_processor_service.DeleteProcessorRequest, dict] = None,
802804
*,
803805
name: str = None,
804806
retry: retries.Retry = gapic_v1.method.DEFAULT,
@@ -810,7 +812,7 @@ def delete_processor(
810812
artifacts associated with this processor.
811813
812814
Args:
813-
request (google.cloud.documentai_v1beta3.types.DeleteProcessorRequest):
815+
request (Union[google.cloud.documentai_v1beta3.types.DeleteProcessorRequest, dict]):
814816
The request object. Request message for the delete
815817
processor method.
816818
name (str):
@@ -892,7 +894,7 @@ def delete_processor(
892894

893895
def enable_processor(
894896
self,
895-
request: document_processor_service.EnableProcessorRequest = None,
897+
request: Union[document_processor_service.EnableProcessorRequest, dict] = None,
896898
*,
897899
retry: retries.Retry = gapic_v1.method.DEFAULT,
898900
timeout: float = None,
@@ -901,7 +903,7 @@ def enable_processor(
901903
r"""Enables a processor
902904
903905
Args:
904-
request (google.cloud.documentai_v1beta3.types.EnableProcessorRequest):
906+
request (Union[google.cloud.documentai_v1beta3.types.EnableProcessorRequest, dict]):
905907
The request object. Request message for the enable
906908
processor method.
907909
retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -953,7 +955,7 @@ def enable_processor(
953955

954956
def disable_processor(
955957
self,
956-
request: document_processor_service.DisableProcessorRequest = None,
958+
request: Union[document_processor_service.DisableProcessorRequest, dict] = None,
957959
*,
958960
retry: retries.Retry = gapic_v1.method.DEFAULT,
959961
timeout: float = None,
@@ -962,7 +964,7 @@ def disable_processor(
962964
r"""Disables a processor
963965
964966
Args:
965-
request (google.cloud.documentai_v1beta3.types.DisableProcessorRequest):
967+
request (Union[google.cloud.documentai_v1beta3.types.DisableProcessorRequest, dict]):
966968
The request object. Request message for the disable
967969
processor method.
968970
retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -1014,7 +1016,7 @@ def disable_processor(
10141016

10151017
def review_document(
10161018
self,
1017-
request: document_processor_service.ReviewDocumentRequest = None,
1019+
request: Union[document_processor_service.ReviewDocumentRequest, dict] = None,
10181020
*,
10191021
human_review_config: str = None,
10201022
retry: retries.Retry = gapic_v1.method.DEFAULT,
@@ -1025,7 +1027,7 @@ def review_document(
10251027
should be processed by the specified processor.
10261028
10271029
Args:
1028-
request (google.cloud.documentai_v1beta3.types.ReviewDocumentRequest):
1030+
request (Union[google.cloud.documentai_v1beta3.types.ReviewDocumentRequest, dict]):
10291031
The request object. Request message for review document
10301032
method. Next Id: 6.
10311033
human_review_config (str):

google/cloud/documentai_v1beta3/services/document_processor_service/transports/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def __init__(
120120
**scopes_kwargs, quota_project_id=quota_project_id
121121
)
122122

123-
# If the credentials is service account credentials, then always try to use self signed JWT.
123+
# If the credentials are service account credentials, then always try to use self signed JWT.
124124
if (
125125
always_use_jwt_access
126126
and isinstance(credentials, service_account.Credentials)

0 commit comments

Comments
 (0)