From a95fac859f1c175080f6fa8c856abd64e5ea9f19 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 24 Sep 2021 15:10:25 +0000 Subject: [PATCH] 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: https://github.com/googleapis/googleapis/commit/b224dfa52642a733ea64849d4e06d15c274bc08f Source-Link: https://github.com/googleapis/googleapis-gen/commit/63a1db7a38d74b9639592f521ed1daaf7299ad9a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjNhMWRiN2EzOGQ3NGI5NjM5NTkyZjUyMWVkMWRhYWY3Mjk5YWQ5YSJ9 --- .../document_processor_service/client.py | 14 +++---- .../transports/base.py | 2 +- .../transports/grpc.py | 6 +-- .../transports/grpc_asyncio.py | 6 +-- .../document_understanding_service/client.py | 12 +++--- .../transports/base.py | 2 +- .../transports/grpc.py | 6 +-- .../transports/grpc_asyncio.py | 6 +-- .../document_processor_service/client.py | 40 ++++++++++--------- .../transports/base.py | 2 +- .../transports/grpc.py | 6 +-- .../transports/grpc_asyncio.py | 6 +-- 12 files changed, 56 insertions(+), 52 deletions(-) diff --git a/google/cloud/documentai_v1/services/document_processor_service/client.py b/google/cloud/documentai_v1/services/document_processor_service/client.py index 228b6114..4e41ca3b 100644 --- a/google/cloud/documentai_v1/services/document_processor_service/client.py +++ b/google/cloud/documentai_v1/services/document_processor_service/client.py @@ -17,7 +17,7 @@ from distutils import util import os import re -from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union +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 @@ -377,7 +377,7 @@ def __init__( def process_document( self, - request: document_processor_service.ProcessRequest = None, + request: Union[document_processor_service.ProcessRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -387,7 +387,7 @@ def process_document( r"""Processes a single document. Args: - request (google.cloud.documentai_v1.types.ProcessRequest): + request (Union[google.cloud.documentai_v1.types.ProcessRequest, dict]): The request object. Request message for the process document method. name (str): @@ -448,7 +448,7 @@ def process_document( def batch_process_documents( self, - request: document_processor_service.BatchProcessRequest = None, + request: Union[document_processor_service.BatchProcessRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -459,7 +459,7 @@ def batch_process_documents( written to Cloud Storage as JSON in the [Document] format. Args: - request (google.cloud.documentai_v1.types.BatchProcessRequest): + request (Union[google.cloud.documentai_v1.types.BatchProcessRequest, dict]): The request object. Request message for batch process document method. name (str): @@ -531,7 +531,7 @@ def batch_process_documents( def review_document( self, - request: document_processor_service.ReviewDocumentRequest = None, + request: Union[document_processor_service.ReviewDocumentRequest, dict] = None, *, human_review_config: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -542,7 +542,7 @@ def review_document( should be processed by the specified processor. Args: - request (google.cloud.documentai_v1.types.ReviewDocumentRequest): + request (Union[google.cloud.documentai_v1.types.ReviewDocumentRequest, dict]): The request object. Request message for review document method. human_review_config (str): diff --git a/google/cloud/documentai_v1/services/document_processor_service/transports/base.py b/google/cloud/documentai_v1/services/document_processor_service/transports/base.py index 26811788..d6e2dc9e 100644 --- a/google/cloud/documentai_v1/services/document_processor_service/transports/base.py +++ b/google/cloud/documentai_v1/services/document_processor_service/transports/base.py @@ -119,7 +119,7 @@ def __init__( **scopes_kwargs, quota_project_id=quota_project_id ) - # If the credentials is service account credentials, then always try to use self signed JWT. + # If the credentials are service account credentials, then always try to use self signed JWT. if ( always_use_jwt_access and isinstance(credentials, service_account.Credentials) diff --git a/google/cloud/documentai_v1/services/document_processor_service/transports/grpc.py b/google/cloud/documentai_v1/services/document_processor_service/transports/grpc.py index 2cdd8efd..ec2b7097 100644 --- a/google/cloud/documentai_v1/services/document_processor_service/transports/grpc.py +++ b/google/cloud/documentai_v1/services/document_processor_service/transports/grpc.py @@ -86,16 +86,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/documentai_v1/services/document_processor_service/transports/grpc_asyncio.py b/google/cloud/documentai_v1/services/document_processor_service/transports/grpc_asyncio.py index 446e9422..ccbd53a1 100644 --- a/google/cloud/documentai_v1/services/document_processor_service/transports/grpc_asyncio.py +++ b/google/cloud/documentai_v1/services/document_processor_service/transports/grpc_asyncio.py @@ -133,16 +133,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. 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 ac1bdd11..b7186056 100644 --- a/google/cloud/documentai_v1beta2/services/document_understanding_service/client.py +++ b/google/cloud/documentai_v1beta2/services/document_understanding_service/client.py @@ -17,7 +17,7 @@ from distutils import util import os import re -from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union +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 @@ -348,7 +348,9 @@ def __init__( def batch_process_documents( self, - request: document_understanding.BatchProcessDocumentsRequest = None, + request: Union[ + document_understanding.BatchProcessDocumentsRequest, dict + ] = None, *, requests: Sequence[document_understanding.ProcessDocumentRequest] = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -359,7 +361,7 @@ def batch_process_documents( written to Cloud Storage as JSON in the [Document] format. Args: - request (google.cloud.documentai_v1beta2.types.BatchProcessDocumentsRequest): + request (Union[google.cloud.documentai_v1beta2.types.BatchProcessDocumentsRequest, dict]): The request object. Request to batch process documents as an asynchronous operation. The output is written to Cloud Storage as JSON in the [Document] format. @@ -431,7 +433,7 @@ def batch_process_documents( def process_document( self, - request: document_understanding.ProcessDocumentRequest = None, + request: Union[document_understanding.ProcessDocumentRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -440,7 +442,7 @@ def process_document( r"""Processes a single document. Args: - request (google.cloud.documentai_v1beta2.types.ProcessDocumentRequest): + request (Union[google.cloud.documentai_v1beta2.types.ProcessDocumentRequest, dict]): The request object. Request to process one document. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. 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 e016c306..eea3885d 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 @@ -120,7 +120,7 @@ def __init__( **scopes_kwargs, quota_project_id=quota_project_id ) - # If the credentials is service account credentials, then always try to use self signed JWT. + # If the credentials are service account credentials, then always try to use self signed JWT. if ( always_use_jwt_access and isinstance(credentials, service_account.Credentials) 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 1cdc916c..465788f6 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 @@ -85,16 +85,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. 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 513a1d3e..7899ad93 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 @@ -134,16 +134,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. 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 1131667d..df27b514 100644 --- a/google/cloud/documentai_v1beta3/services/document_processor_service/client.py +++ b/google/cloud/documentai_v1beta3/services/document_processor_service/client.py @@ -17,7 +17,7 @@ from distutils import util import os import re -from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union +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 @@ -399,7 +399,7 @@ def __init__( def process_document( self, - request: document_processor_service.ProcessRequest = None, + request: Union[document_processor_service.ProcessRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -409,7 +409,7 @@ def process_document( r"""Processes a single document. Args: - request (google.cloud.documentai_v1beta3.types.ProcessRequest): + request (Union[google.cloud.documentai_v1beta3.types.ProcessRequest, dict]): The request object. Request message for the process document method. name (str): @@ -470,7 +470,7 @@ def process_document( def batch_process_documents( self, - request: document_processor_service.BatchProcessRequest = None, + request: Union[document_processor_service.BatchProcessRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -481,7 +481,7 @@ def batch_process_documents( written to Cloud Storage as JSON in the [Document] format. Args: - request (google.cloud.documentai_v1beta3.types.BatchProcessRequest): + request (Union[google.cloud.documentai_v1beta3.types.BatchProcessRequest, dict]): The request object. Request message for batch process document method. name (str): @@ -553,7 +553,9 @@ def batch_process_documents( def fetch_processor_types( self, - request: document_processor_service.FetchProcessorTypesRequest = None, + request: Union[ + document_processor_service.FetchProcessorTypesRequest, dict + ] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -563,7 +565,7 @@ def fetch_processor_types( r"""Fetches processor types. Args: - request (google.cloud.documentai_v1beta3.types.FetchProcessorTypesRequest): + request (Union[google.cloud.documentai_v1beta3.types.FetchProcessorTypesRequest, dict]): The request object. Request message for fetch processor types. parent (str): @@ -627,7 +629,7 @@ def fetch_processor_types( def list_processors( self, - request: document_processor_service.ListProcessorsRequest = None, + request: Union[document_processor_service.ListProcessorsRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -637,7 +639,7 @@ def list_processors( r"""Lists all processors which belong to this project. Args: - request (google.cloud.documentai_v1beta3.types.ListProcessorsRequest): + request (Union[google.cloud.documentai_v1beta3.types.ListProcessorsRequest, dict]): The request object. Request message for list all processors belongs to a project. parent (str): @@ -708,7 +710,7 @@ def list_processors( def create_processor( self, - request: document_processor_service.CreateProcessorRequest = None, + request: Union[document_processor_service.CreateProcessorRequest, dict] = None, *, parent: str = None, processor: gcd_processor.Processor = None, @@ -721,7 +723,7 @@ def create_processor( default after its creation. Args: - request (google.cloud.documentai_v1beta3.types.CreateProcessorRequest): + request (Union[google.cloud.documentai_v1beta3.types.CreateProcessorRequest, dict]): The request object. Request message for create a processor. Notice this request is sent to a regionalized backend service, and if the processor type is not @@ -798,7 +800,7 @@ def create_processor( def delete_processor( self, - request: document_processor_service.DeleteProcessorRequest = None, + request: Union[document_processor_service.DeleteProcessorRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -810,7 +812,7 @@ def delete_processor( artifacts associated with this processor. Args: - request (google.cloud.documentai_v1beta3.types.DeleteProcessorRequest): + request (Union[google.cloud.documentai_v1beta3.types.DeleteProcessorRequest, dict]): The request object. Request message for the delete processor method. name (str): @@ -892,7 +894,7 @@ def delete_processor( def enable_processor( self, - request: document_processor_service.EnableProcessorRequest = None, + request: Union[document_processor_service.EnableProcessorRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -901,7 +903,7 @@ def enable_processor( r"""Enables a processor Args: - request (google.cloud.documentai_v1beta3.types.EnableProcessorRequest): + request (Union[google.cloud.documentai_v1beta3.types.EnableProcessorRequest, dict]): The request object. Request message for the enable processor method. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -953,7 +955,7 @@ def enable_processor( def disable_processor( self, - request: document_processor_service.DisableProcessorRequest = None, + request: Union[document_processor_service.DisableProcessorRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -962,7 +964,7 @@ def disable_processor( r"""Disables a processor Args: - request (google.cloud.documentai_v1beta3.types.DisableProcessorRequest): + request (Union[google.cloud.documentai_v1beta3.types.DisableProcessorRequest, dict]): The request object. Request message for the disable processor method. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1014,7 +1016,7 @@ def disable_processor( def review_document( self, - request: document_processor_service.ReviewDocumentRequest = None, + request: Union[document_processor_service.ReviewDocumentRequest, dict] = None, *, human_review_config: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1025,7 +1027,7 @@ def review_document( should be processed by the specified processor. Args: - request (google.cloud.documentai_v1beta3.types.ReviewDocumentRequest): + request (Union[google.cloud.documentai_v1beta3.types.ReviewDocumentRequest, dict]): The request object. Request message for review document method. Next Id: 6. human_review_config (str): 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 f87da34b..3dd2e2ac 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 @@ -120,7 +120,7 @@ def __init__( **scopes_kwargs, quota_project_id=quota_project_id ) - # If the credentials is service account credentials, then always try to use self signed JWT. + # If the credentials are service account credentials, then always try to use self signed JWT. if ( always_use_jwt_access and isinstance(credentials, service_account.Credentials) 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 35cfbbb0..f40eb9f2 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 @@ -87,16 +87,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. 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 1cc626bf..73b3a37c 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 @@ -134,16 +134,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota.