From 0c271c073004b927c65160b3c474e9c6e24c7895 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:12:16 +0000 Subject: [PATCH] chore: use gapic-generator-python 0.51.2 (#125) - [ ] 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 --- .../services/web_risk_service/client.py | 18 +++++++++--------- .../web_risk_service/transports/base.py | 2 +- .../web_risk_service/transports/grpc.py | 6 +++--- .../transports/grpc_asyncio.py | 6 +++--- .../web_risk_service_v1_beta1/client.py | 14 +++++++------- .../transports/base.py | 2 +- .../transports/grpc.py | 6 +++--- .../transports/grpc_asyncio.py | 6 +++--- scripts/fixup_webrisk_v1_keywords.py | 10 +++++----- scripts/fixup_webrisk_v1beta1_keywords.py | 8 ++++---- 10 files changed, 39 insertions(+), 39 deletions(-) diff --git a/google/cloud/webrisk_v1/services/web_risk_service/client.py b/google/cloud/webrisk_v1/services/web_risk_service/client.py index d0ad40b..213978f 100644 --- a/google/cloud/webrisk_v1/services/web_risk_service/client.py +++ b/google/cloud/webrisk_v1/services/web_risk_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 @@ -338,7 +338,7 @@ def __init__( def compute_threat_list_diff( self, - request: webrisk.ComputeThreatListDiffRequest = None, + request: Union[webrisk.ComputeThreatListDiffRequest, dict] = None, *, threat_type: webrisk.ThreatType = None, version_token: bytes = None, @@ -357,7 +357,7 @@ def compute_threat_list_diff( once for each list. Args: - request (google.cloud.webrisk_v1.types.ComputeThreatListDiffRequest): + request (Union[google.cloud.webrisk_v1.types.ComputeThreatListDiffRequest, dict]): The request object. Describes an API diff request. threat_type (google.cloud.webrisk_v1.types.ThreatType): Required. The threat list to update. @@ -435,7 +435,7 @@ def compute_threat_list_diff( def search_uris( self, - request: webrisk.SearchUrisRequest = None, + request: Union[webrisk.SearchUrisRequest, dict] = None, *, uri: str = None, threat_types: Sequence[webrisk.ThreatType] = None, @@ -451,7 +451,7 @@ def search_uris( response will be returned. Args: - request (google.cloud.webrisk_v1.types.SearchUrisRequest): + request (Union[google.cloud.webrisk_v1.types.SearchUrisRequest, dict]): The request object. Request to check URI entries against threatLists. uri (str): @@ -514,7 +514,7 @@ def search_uris( def search_hashes( self, - request: webrisk.SearchHashesRequest = None, + request: Union[webrisk.SearchHashesRequest, dict] = None, *, hash_prefix: bytes = None, threat_types: Sequence[webrisk.ThreatType] = None, @@ -530,7 +530,7 @@ def search_hashes( match of a threat. Args: - request (google.cloud.webrisk_v1.types.SearchHashesRequest): + request (Union[google.cloud.webrisk_v1.types.SearchHashesRequest, dict]): The request object. Request to return full hashes matched by the provided hash prefixes. hash_prefix (bytes): @@ -595,7 +595,7 @@ def search_hashes( def create_submission( self, - request: webrisk.CreateSubmissionRequest = None, + request: Union[webrisk.CreateSubmissionRequest, dict] = None, *, parent: str = None, submission: webrisk.Submission = None, @@ -613,7 +613,7 @@ def create_submission( visibility can use this method. Args: - request (google.cloud.webrisk_v1.types.CreateSubmissionRequest): + request (Union[google.cloud.webrisk_v1.types.CreateSubmissionRequest, dict]): The request object. Request to send a potentially phishy URI to WebRisk. parent (str): diff --git a/google/cloud/webrisk_v1/services/web_risk_service/transports/base.py b/google/cloud/webrisk_v1/services/web_risk_service/transports/base.py index 8d74b17..6aabcba 100644 --- a/google/cloud/webrisk_v1/services/web_risk_service/transports/base.py +++ b/google/cloud/webrisk_v1/services/web_risk_service/transports/base.py @@ -115,7 +115,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/webrisk_v1/services/web_risk_service/transports/grpc.py b/google/cloud/webrisk_v1/services/web_risk_service/transports/grpc.py index 50f4130..b36ca6b 100644 --- a/google/cloud/webrisk_v1/services/web_risk_service/transports/grpc.py +++ b/google/cloud/webrisk_v1/services/web_risk_service/transports/grpc.py @@ -81,16 +81,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/webrisk_v1/services/web_risk_service/transports/grpc_asyncio.py b/google/cloud/webrisk_v1/services/web_risk_service/transports/grpc_asyncio.py index a0667ff..e2a1cbf 100644 --- a/google/cloud/webrisk_v1/services/web_risk_service/transports/grpc_asyncio.py +++ b/google/cloud/webrisk_v1/services/web_risk_service/transports/grpc_asyncio.py @@ -128,16 +128,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/webrisk_v1beta1/services/web_risk_service_v1_beta1/client.py b/google/cloud/webrisk_v1beta1/services/web_risk_service_v1_beta1/client.py index a099a60..99a4df5 100644 --- a/google/cloud/webrisk_v1beta1/services/web_risk_service_v1_beta1/client.py +++ b/google/cloud/webrisk_v1beta1/services/web_risk_service_v1_beta1/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 @@ -340,7 +340,7 @@ def __init__( def compute_threat_list_diff( self, - request: webrisk.ComputeThreatListDiffRequest = None, + request: Union[webrisk.ComputeThreatListDiffRequest, dict] = None, *, threat_type: webrisk.ThreatType = None, version_token: bytes = None, @@ -352,7 +352,7 @@ def compute_threat_list_diff( r"""Gets the most recent threat list diffs. Args: - request (google.cloud.webrisk_v1beta1.types.ComputeThreatListDiffRequest): + request (Union[google.cloud.webrisk_v1beta1.types.ComputeThreatListDiffRequest, dict]): The request object. Describes an API diff request. threat_type (google.cloud.webrisk_v1beta1.types.ThreatType): The ThreatList to update. @@ -422,7 +422,7 @@ def compute_threat_list_diff( def search_uris( self, - request: webrisk.SearchUrisRequest = None, + request: Union[webrisk.SearchUrisRequest, dict] = None, *, uri: str = None, threat_types: Sequence[webrisk.ThreatType] = None, @@ -434,7 +434,7 @@ def search_uris( given threatList. Args: - request (google.cloud.webrisk_v1beta1.types.SearchUrisRequest): + request (Union[google.cloud.webrisk_v1beta1.types.SearchUrisRequest, dict]): The request object. Request to check URI entries against threatLists. uri (str): @@ -496,7 +496,7 @@ def search_uris( def search_hashes( self, - request: webrisk.SearchHashesRequest = None, + request: Union[webrisk.SearchHashesRequest, dict] = None, *, hash_prefix: bytes = None, threat_types: Sequence[webrisk.ThreatType] = None, @@ -512,7 +512,7 @@ def search_hashes( match of a threat. Args: - request (google.cloud.webrisk_v1beta1.types.SearchHashesRequest): + request (Union[google.cloud.webrisk_v1beta1.types.SearchHashesRequest, dict]): The request object. Request to return full hashes matched by the provided hash prefixes. hash_prefix (bytes): diff --git a/google/cloud/webrisk_v1beta1/services/web_risk_service_v1_beta1/transports/base.py b/google/cloud/webrisk_v1beta1/services/web_risk_service_v1_beta1/transports/base.py index b2ff921..5d2ec55 100644 --- a/google/cloud/webrisk_v1beta1/services/web_risk_service_v1_beta1/transports/base.py +++ b/google/cloud/webrisk_v1beta1/services/web_risk_service_v1_beta1/transports/base.py @@ -115,7 +115,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/webrisk_v1beta1/services/web_risk_service_v1_beta1/transports/grpc.py b/google/cloud/webrisk_v1beta1/services/web_risk_service_v1_beta1/transports/grpc.py index d67a077..c843b40 100644 --- a/google/cloud/webrisk_v1beta1/services/web_risk_service_v1_beta1/transports/grpc.py +++ b/google/cloud/webrisk_v1beta1/services/web_risk_service_v1_beta1/transports/grpc.py @@ -81,16 +81,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/webrisk_v1beta1/services/web_risk_service_v1_beta1/transports/grpc_asyncio.py b/google/cloud/webrisk_v1beta1/services/web_risk_service_v1_beta1/transports/grpc_asyncio.py index 24547ff..cef5be1 100644 --- a/google/cloud/webrisk_v1beta1/services/web_risk_service_v1_beta1/transports/grpc_asyncio.py +++ b/google/cloud/webrisk_v1beta1/services/web_risk_service_v1_beta1/transports/grpc_asyncio.py @@ -128,16 +128,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/scripts/fixup_webrisk_v1_keywords.py b/scripts/fixup_webrisk_v1_keywords.py index db9f1d3..81213ab 100644 --- a/scripts/fixup_webrisk_v1_keywords.py +++ b/scripts/fixup_webrisk_v1_keywords.py @@ -39,10 +39,10 @@ def partition( class webriskCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'compute_threat_list_diff': ('threat_type', 'constraints', 'version_token', ), - 'create_submission': ('parent', 'submission', ), - 'search_hashes': ('threat_types', 'hash_prefix', ), - 'search_uris': ('uri', 'threat_types', ), + 'compute_threat_list_diff': ('threat_type', 'constraints', 'version_token', ), + 'create_submission': ('parent', 'submission', ), + 'search_hashes': ('threat_types', 'hash_prefix', ), + 'search_uris': ('uri', 'threat_types', ), } def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: @@ -61,7 +61,7 @@ def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: return updated kwargs, ctrl_kwargs = partition( - lambda a: not a.keyword.value in self.CTRL_PARAMS, + lambda a: a.keyword.value not in self.CTRL_PARAMS, kwargs ) diff --git a/scripts/fixup_webrisk_v1beta1_keywords.py b/scripts/fixup_webrisk_v1beta1_keywords.py index 4b1391c..421426d 100644 --- a/scripts/fixup_webrisk_v1beta1_keywords.py +++ b/scripts/fixup_webrisk_v1beta1_keywords.py @@ -39,9 +39,9 @@ def partition( class webriskCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'compute_threat_list_diff': ('threat_type', 'constraints', 'version_token', ), - 'search_hashes': ('threat_types', 'hash_prefix', ), - 'search_uris': ('uri', 'threat_types', ), + 'compute_threat_list_diff': ('threat_type', 'constraints', 'version_token', ), + 'search_hashes': ('threat_types', 'hash_prefix', ), + 'search_uris': ('uri', 'threat_types', ), } def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: @@ -60,7 +60,7 @@ def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: return updated kwargs, ctrl_kwargs = partition( - lambda a: not a.keyword.value in self.CTRL_PARAMS, + lambda a: a.keyword.value not in self.CTRL_PARAMS, kwargs )