diff --git a/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/client.py b/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/client.py index 5cc7336..50bb383 100644 --- a/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/client.py +++ b/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_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 @@ -378,7 +378,7 @@ def __init__( def create_assessment( self, - request: recaptchaenterprise.CreateAssessmentRequest = None, + request: Union[recaptchaenterprise.CreateAssessmentRequest, dict] = None, *, parent: str = None, assessment: recaptchaenterprise.Assessment = None, @@ -390,7 +390,7 @@ def create_assessment( legitimate. Args: - request (google.cloud.recaptchaenterprise_v1.types.CreateAssessmentRequest): + request (Union[google.cloud.recaptchaenterprise_v1.types.CreateAssessmentRequest, dict]): The request object. The create assessment request message. parent (str): @@ -457,7 +457,7 @@ def create_assessment( def annotate_assessment( self, - request: recaptchaenterprise.AnnotateAssessmentRequest = None, + request: Union[recaptchaenterprise.AnnotateAssessmentRequest, dict] = None, *, name: str = None, annotation: recaptchaenterprise.AnnotateAssessmentRequest.Annotation = None, @@ -470,7 +470,7 @@ def annotate_assessment( to be authentic or fraudulent. Args: - request (google.cloud.recaptchaenterprise_v1.types.AnnotateAssessmentRequest): + request (Union[google.cloud.recaptchaenterprise_v1.types.AnnotateAssessmentRequest, dict]): The request object. The request message to annotate an Assessment. name (str): @@ -544,7 +544,7 @@ def annotate_assessment( def create_key( self, - request: recaptchaenterprise.CreateKeyRequest = None, + request: Union[recaptchaenterprise.CreateKeyRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -553,7 +553,7 @@ def create_key( r"""Creates a new reCAPTCHA Enterprise key. Args: - request (google.cloud.recaptchaenterprise_v1.types.CreateKeyRequest): + request (Union[google.cloud.recaptchaenterprise_v1.types.CreateKeyRequest, dict]): The request object. The create key request message. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -594,7 +594,7 @@ def create_key( def list_keys( self, - request: recaptchaenterprise.ListKeysRequest = None, + request: Union[recaptchaenterprise.ListKeysRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -604,7 +604,7 @@ def list_keys( project. Args: - request (google.cloud.recaptchaenterprise_v1.types.ListKeysRequest): + request (Union[google.cloud.recaptchaenterprise_v1.types.ListKeysRequest, dict]): The request object. The list keys request message. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -653,7 +653,7 @@ def list_keys( def get_key( self, - request: recaptchaenterprise.GetKeyRequest = None, + request: Union[recaptchaenterprise.GetKeyRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -662,7 +662,7 @@ def get_key( r"""Returns the specified key. Args: - request (google.cloud.recaptchaenterprise_v1.types.GetKeyRequest): + request (Union[google.cloud.recaptchaenterprise_v1.types.GetKeyRequest, dict]): The request object. The get key request message. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -703,7 +703,7 @@ def get_key( def update_key( self, - request: recaptchaenterprise.UpdateKeyRequest = None, + request: Union[recaptchaenterprise.UpdateKeyRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -712,7 +712,7 @@ def update_key( r"""Updates the specified key. Args: - request (google.cloud.recaptchaenterprise_v1.types.UpdateKeyRequest): + request (Union[google.cloud.recaptchaenterprise_v1.types.UpdateKeyRequest, dict]): The request object. The update key request message. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -753,7 +753,7 @@ def update_key( def delete_key( self, - request: recaptchaenterprise.DeleteKeyRequest = None, + request: Union[recaptchaenterprise.DeleteKeyRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -762,7 +762,7 @@ def delete_key( r"""Deletes the specified key. Args: - request (google.cloud.recaptchaenterprise_v1.types.DeleteKeyRequest): + request (Union[google.cloud.recaptchaenterprise_v1.types.DeleteKeyRequest, dict]): The request object. The delete key request message. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -795,7 +795,7 @@ def delete_key( def migrate_key( self, - request: recaptchaenterprise.MigrateKeyRequest = None, + request: Union[recaptchaenterprise.MigrateKeyRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -810,7 +810,7 @@ def migrate_key( role in the destination project. Args: - request (google.cloud.recaptchaenterprise_v1.types.MigrateKeyRequest): + request (Union[google.cloud.recaptchaenterprise_v1.types.MigrateKeyRequest, dict]): The request object. The migrate key request message. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -851,7 +851,7 @@ def migrate_key( def get_metrics( self, - request: recaptchaenterprise.GetMetricsRequest = None, + request: Union[recaptchaenterprise.GetMetricsRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -862,7 +862,7 @@ def get_metrics( be used to build dashboards. Args: - request (google.cloud.recaptchaenterprise_v1.types.GetMetricsRequest): + request (Union[google.cloud.recaptchaenterprise_v1.types.GetMetricsRequest, dict]): The request object. The get metrics request message. name (str): Required. The name of the requested diff --git a/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/transports/base.py b/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/transports/base.py index 9e46682..b9090a9 100644 --- a/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/transports/base.py +++ b/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/transports/base.py @@ -118,7 +118,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/recaptchaenterprise_v1/services/recaptcha_enterprise_service/transports/grpc.py b/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/transports/grpc.py index fb5dbf3..39dcefc 100644 --- a/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/transports/grpc.py +++ b/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_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/recaptchaenterprise_v1/services/recaptcha_enterprise_service/transports/grpc_asyncio.py b/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/transports/grpc_asyncio.py index cd0a764..f7975ce 100644 --- a/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/transports/grpc_asyncio.py +++ b/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/transports/grpc_asyncio.py @@ -130,16 +130,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_recaptchaenterprise_v1_keywords.py b/scripts/fixup_recaptchaenterprise_v1_keywords.py index bde3f26..9674209 100644 --- a/scripts/fixup_recaptchaenterprise_v1_keywords.py +++ b/scripts/fixup_recaptchaenterprise_v1_keywords.py @@ -39,15 +39,15 @@ def partition( class recaptchaenterpriseCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'annotate_assessment': ('name', 'annotation', 'reasons', ), - 'create_assessment': ('parent', 'assessment', ), - 'create_key': ('parent', 'key', ), - 'delete_key': ('name', ), - 'get_key': ('name', ), - 'get_metrics': ('name', ), - 'list_keys': ('parent', 'page_size', 'page_token', ), - 'migrate_key': ('name', ), - 'update_key': ('key', 'update_mask', ), + 'annotate_assessment': ('name', 'annotation', 'reasons', ), + 'create_assessment': ('parent', 'assessment', ), + 'create_key': ('parent', 'key', ), + 'delete_key': ('name', ), + 'get_key': ('name', ), + 'get_metrics': ('name', ), + 'list_keys': ('parent', 'page_size', 'page_token', ), + 'migrate_key': ('name', ), + 'update_key': ('key', 'update_mask', ), } def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: @@ -66,7 +66,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 )