From e75ada858d00b22fbae6d0de40771239d2f71756 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 16:00:15 +0000 Subject: [PATCH] chore: use gapic-generator-python 0.51.2 (#256) - [ ] 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 --- .../cloud/speech_v1/services/speech/client.py | 20 +++------ .../services/speech/transports/base.py | 2 +- .../services/speech/transports/grpc.py | 6 +-- .../speech/transports/grpc_asyncio.py | 6 +-- .../services/adaptation/client.py | 42 +++++++++---------- .../services/adaptation/transports/base.py | 2 +- .../services/adaptation/transports/grpc.py | 6 +-- .../adaptation/transports/grpc_asyncio.py | 6 +-- .../services/speech/client.py | 20 +++------ .../services/speech/transports/base.py | 2 +- .../services/speech/transports/grpc.py | 6 +-- .../speech/transports/grpc_asyncio.py | 6 +-- scripts/fixup_speech_v1_keywords.py | 8 ++-- scripts/fixup_speech_v1p1beta1_keywords.py | 28 ++++++------- 14 files changed, 70 insertions(+), 90 deletions(-) diff --git a/google/cloud/speech_v1/services/speech/client.py b/google/cloud/speech_v1/services/speech/client.py index fe9a005f..5649465b 100644 --- a/google/cloud/speech_v1/services/speech/client.py +++ b/google/cloud/speech_v1/services/speech/client.py @@ -17,17 +17,7 @@ from distutils import util import os import re -from typing import ( - Callable, - Dict, - Optional, - Iterable, - Iterator, - Sequence, - Tuple, - Type, - Union, -) +from typing import Dict, Optional, Iterable, Iterator, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib # type: ignore @@ -347,7 +337,7 @@ def __init__( def recognize( self, - request: cloud_speech.RecognizeRequest = None, + request: Union[cloud_speech.RecognizeRequest, dict] = None, *, config: cloud_speech.RecognitionConfig = None, audio: cloud_speech.RecognitionAudio = None, @@ -359,7 +349,7 @@ def recognize( results after all audio has been sent and processed. Args: - request (google.cloud.speech_v1.types.RecognizeRequest): + request (Union[google.cloud.speech_v1.types.RecognizeRequest, dict]): The request object. The top-level message sent by the client for the `Recognize` method. config (google.cloud.speech_v1.types.RecognitionConfig): @@ -425,7 +415,7 @@ def recognize( def long_running_recognize( self, - request: cloud_speech.LongRunningRecognizeRequest = None, + request: Union[cloud_speech.LongRunningRecognizeRequest, dict] = None, *, config: cloud_speech.RecognitionConfig = None, audio: cloud_speech.RecognitionAudio = None, @@ -441,7 +431,7 @@ def long_running_recognize( `how-to `__. Args: - request (google.cloud.speech_v1.types.LongRunningRecognizeRequest): + request (Union[google.cloud.speech_v1.types.LongRunningRecognizeRequest, dict]): The request object. The top-level message sent by the client for the `LongRunningRecognize` method. config (google.cloud.speech_v1.types.RecognitionConfig): diff --git a/google/cloud/speech_v1/services/speech/transports/base.py b/google/cloud/speech_v1/services/speech/transports/base.py index 86fa0650..9d7d46db 100644 --- a/google/cloud/speech_v1/services/speech/transports/base.py +++ b/google/cloud/speech_v1/services/speech/transports/base.py @@ -117,7 +117,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/speech_v1/services/speech/transports/grpc.py b/google/cloud/speech_v1/services/speech/transports/grpc.py index badd3400..253545e4 100644 --- a/google/cloud/speech_v1/services/speech/transports/grpc.py +++ b/google/cloud/speech_v1/services/speech/transports/grpc.py @@ -82,16 +82,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/speech_v1/services/speech/transports/grpc_asyncio.py b/google/cloud/speech_v1/services/speech/transports/grpc_asyncio.py index 22b218ae..caf98f57 100644 --- a/google/cloud/speech_v1/services/speech/transports/grpc_asyncio.py +++ b/google/cloud/speech_v1/services/speech/transports/grpc_asyncio.py @@ -129,16 +129,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/speech_v1p1beta1/services/adaptation/client.py b/google/cloud/speech_v1p1beta1/services/adaptation/client.py index 5b70526d..42c458e4 100644 --- a/google/cloud/speech_v1p1beta1/services/adaptation/client.py +++ b/google/cloud/speech_v1p1beta1/services/adaptation/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 @@ -368,7 +368,7 @@ def __init__( def create_phrase_set( self, - request: cloud_speech_adaptation.CreatePhraseSetRequest = None, + request: Union[cloud_speech_adaptation.CreatePhraseSetRequest, dict] = None, *, parent: str = None, phrase_set: resource.PhraseSet = None, @@ -383,7 +383,7 @@ def create_phrase_set( when you send a call that includes the PhraseSet. Args: - request (google.cloud.speech_v1p1beta1.types.CreatePhraseSetRequest): + request (Union[google.cloud.speech_v1p1beta1.types.CreatePhraseSetRequest, dict]): The request object. Message sent by the client for the `CreatePhraseSet` method. parent (str): @@ -466,7 +466,7 @@ def create_phrase_set( def get_phrase_set( self, - request: cloud_speech_adaptation.GetPhraseSetRequest = None, + request: Union[cloud_speech_adaptation.GetPhraseSetRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -476,7 +476,7 @@ def get_phrase_set( r"""Get a phrase set. Args: - request (google.cloud.speech_v1p1beta1.types.GetPhraseSetRequest): + request (Union[google.cloud.speech_v1p1beta1.types.GetPhraseSetRequest, dict]): The request object. Message sent by the client for the `GetPhraseSet` method. name (str): @@ -539,7 +539,7 @@ def get_phrase_set( def list_phrase_set( self, - request: cloud_speech_adaptation.ListPhraseSetRequest = None, + request: Union[cloud_speech_adaptation.ListPhraseSetRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -549,7 +549,7 @@ def list_phrase_set( r"""List phrase sets. Args: - request (google.cloud.speech_v1p1beta1.types.ListPhraseSetRequest): + request (Union[google.cloud.speech_v1p1beta1.types.ListPhraseSetRequest, dict]): The request object. Message sent by the client for the `ListPhraseSet` method. parent (str): @@ -620,7 +620,7 @@ def list_phrase_set( def update_phrase_set( self, - request: cloud_speech_adaptation.UpdatePhraseSetRequest = None, + request: Union[cloud_speech_adaptation.UpdatePhraseSetRequest, dict] = None, *, phrase_set: resource.PhraseSet = None, update_mask: field_mask_pb2.FieldMask = None, @@ -631,7 +631,7 @@ def update_phrase_set( r"""Update a phrase set. Args: - request (google.cloud.speech_v1p1beta1.types.UpdatePhraseSetRequest): + request (Union[google.cloud.speech_v1p1beta1.types.UpdatePhraseSetRequest, dict]): The request object. Message sent by the client for the `UpdatePhraseSet` method. phrase_set (google.cloud.speech_v1p1beta1.types.PhraseSet): @@ -705,7 +705,7 @@ def update_phrase_set( def delete_phrase_set( self, - request: cloud_speech_adaptation.DeletePhraseSetRequest = None, + request: Union[cloud_speech_adaptation.DeletePhraseSetRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -715,7 +715,7 @@ def delete_phrase_set( r"""Delete a phrase set. Args: - request (google.cloud.speech_v1p1beta1.types.DeletePhraseSetRequest): + request (Union[google.cloud.speech_v1p1beta1.types.DeletePhraseSetRequest, dict]): The request object. Message sent by the client for the `DeletePhraseSet` method. name (str): @@ -769,7 +769,7 @@ def delete_phrase_set( def create_custom_class( self, - request: cloud_speech_adaptation.CreateCustomClassRequest = None, + request: Union[cloud_speech_adaptation.CreateCustomClassRequest, dict] = None, *, parent: str = None, custom_class: resource.CustomClass = None, @@ -781,7 +781,7 @@ def create_custom_class( r"""Create a custom class. Args: - request (google.cloud.speech_v1p1beta1.types.CreateCustomClassRequest): + request (Union[google.cloud.speech_v1p1beta1.types.CreateCustomClassRequest, dict]): The request object. Message sent by the client for the `CreateCustomClass` method. parent (str): @@ -868,7 +868,7 @@ def create_custom_class( def get_custom_class( self, - request: cloud_speech_adaptation.GetCustomClassRequest = None, + request: Union[cloud_speech_adaptation.GetCustomClassRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -878,7 +878,7 @@ def get_custom_class( r"""Get a custom class. Args: - request (google.cloud.speech_v1p1beta1.types.GetCustomClassRequest): + request (Union[google.cloud.speech_v1p1beta1.types.GetCustomClassRequest, dict]): The request object. Message sent by the client for the `GetCustomClass` method. name (str): @@ -945,7 +945,7 @@ def get_custom_class( def list_custom_classes( self, - request: cloud_speech_adaptation.ListCustomClassesRequest = None, + request: Union[cloud_speech_adaptation.ListCustomClassesRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -955,7 +955,7 @@ def list_custom_classes( r"""List custom classes. Args: - request (google.cloud.speech_v1p1beta1.types.ListCustomClassesRequest): + request (Union[google.cloud.speech_v1p1beta1.types.ListCustomClassesRequest, dict]): The request object. Message sent by the client for the `ListCustomClasses` method. parent (str): @@ -1026,7 +1026,7 @@ def list_custom_classes( def update_custom_class( self, - request: cloud_speech_adaptation.UpdateCustomClassRequest = None, + request: Union[cloud_speech_adaptation.UpdateCustomClassRequest, dict] = None, *, custom_class: resource.CustomClass = None, update_mask: field_mask_pb2.FieldMask = None, @@ -1037,7 +1037,7 @@ def update_custom_class( r"""Update a custom class. Args: - request (google.cloud.speech_v1p1beta1.types.UpdateCustomClassRequest): + request (Union[google.cloud.speech_v1p1beta1.types.UpdateCustomClassRequest, dict]): The request object. Message sent by the client for the `UpdateCustomClass` method. custom_class (google.cloud.speech_v1p1beta1.types.CustomClass): @@ -1115,7 +1115,7 @@ def update_custom_class( def delete_custom_class( self, - request: cloud_speech_adaptation.DeleteCustomClassRequest = None, + request: Union[cloud_speech_adaptation.DeleteCustomClassRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1125,7 +1125,7 @@ def delete_custom_class( r"""Delete a custom class. Args: - request (google.cloud.speech_v1p1beta1.types.DeleteCustomClassRequest): + request (Union[google.cloud.speech_v1p1beta1.types.DeleteCustomClassRequest, dict]): The request object. Message sent by the client for the `DeleteCustomClass` method. name (str): diff --git a/google/cloud/speech_v1p1beta1/services/adaptation/transports/base.py b/google/cloud/speech_v1p1beta1/services/adaptation/transports/base.py index e3c131b2..b26561bf 100644 --- a/google/cloud/speech_v1p1beta1/services/adaptation/transports/base.py +++ b/google/cloud/speech_v1p1beta1/services/adaptation/transports/base.py @@ -117,7 +117,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/speech_v1p1beta1/services/adaptation/transports/grpc.py b/google/cloud/speech_v1p1beta1/services/adaptation/transports/grpc.py index 0b1b27fb..9b82e03a 100644 --- a/google/cloud/speech_v1p1beta1/services/adaptation/transports/grpc.py +++ b/google/cloud/speech_v1p1beta1/services/adaptation/transports/grpc.py @@ -82,16 +82,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/speech_v1p1beta1/services/adaptation/transports/grpc_asyncio.py b/google/cloud/speech_v1p1beta1/services/adaptation/transports/grpc_asyncio.py index 2b1537db..d09886bc 100644 --- a/google/cloud/speech_v1p1beta1/services/adaptation/transports/grpc_asyncio.py +++ b/google/cloud/speech_v1p1beta1/services/adaptation/transports/grpc_asyncio.py @@ -129,16 +129,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/speech_v1p1beta1/services/speech/client.py b/google/cloud/speech_v1p1beta1/services/speech/client.py index cd50d07a..4e478223 100644 --- a/google/cloud/speech_v1p1beta1/services/speech/client.py +++ b/google/cloud/speech_v1p1beta1/services/speech/client.py @@ -17,17 +17,7 @@ from distutils import util import os import re -from typing import ( - Callable, - Dict, - Optional, - Iterable, - Iterator, - Sequence, - Tuple, - Type, - Union, -) +from typing import Dict, Optional, Iterable, Iterator, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib # type: ignore @@ -379,7 +369,7 @@ def __init__( def recognize( self, - request: cloud_speech.RecognizeRequest = None, + request: Union[cloud_speech.RecognizeRequest, dict] = None, *, config: cloud_speech.RecognitionConfig = None, audio: cloud_speech.RecognitionAudio = None, @@ -391,7 +381,7 @@ def recognize( results after all audio has been sent and processed. Args: - request (google.cloud.speech_v1p1beta1.types.RecognizeRequest): + request (Union[google.cloud.speech_v1p1beta1.types.RecognizeRequest, dict]): The request object. The top-level message sent by the client for the `Recognize` method. config (google.cloud.speech_v1p1beta1.types.RecognitionConfig): @@ -457,7 +447,7 @@ def recognize( def long_running_recognize( self, - request: cloud_speech.LongRunningRecognizeRequest = None, + request: Union[cloud_speech.LongRunningRecognizeRequest, dict] = None, *, config: cloud_speech.RecognitionConfig = None, audio: cloud_speech.RecognitionAudio = None, @@ -473,7 +463,7 @@ def long_running_recognize( `how-to `__. Args: - request (google.cloud.speech_v1p1beta1.types.LongRunningRecognizeRequest): + request (Union[google.cloud.speech_v1p1beta1.types.LongRunningRecognizeRequest, dict]): The request object. The top-level message sent by the client for the `LongRunningRecognize` method. config (google.cloud.speech_v1p1beta1.types.RecognitionConfig): diff --git a/google/cloud/speech_v1p1beta1/services/speech/transports/base.py b/google/cloud/speech_v1p1beta1/services/speech/transports/base.py index 74866e20..f5c65061 100644 --- a/google/cloud/speech_v1p1beta1/services/speech/transports/base.py +++ b/google/cloud/speech_v1p1beta1/services/speech/transports/base.py @@ -117,7 +117,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/speech_v1p1beta1/services/speech/transports/grpc.py b/google/cloud/speech_v1p1beta1/services/speech/transports/grpc.py index b1ad5f8d..af059284 100644 --- a/google/cloud/speech_v1p1beta1/services/speech/transports/grpc.py +++ b/google/cloud/speech_v1p1beta1/services/speech/transports/grpc.py @@ -82,16 +82,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/speech_v1p1beta1/services/speech/transports/grpc_asyncio.py b/google/cloud/speech_v1p1beta1/services/speech/transports/grpc_asyncio.py index e6e6198a..7083ae0b 100644 --- a/google/cloud/speech_v1p1beta1/services/speech/transports/grpc_asyncio.py +++ b/google/cloud/speech_v1p1beta1/services/speech/transports/grpc_asyncio.py @@ -129,16 +129,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_speech_v1_keywords.py b/scripts/fixup_speech_v1_keywords.py index 0ffcae10..018711bf 100644 --- a/scripts/fixup_speech_v1_keywords.py +++ b/scripts/fixup_speech_v1_keywords.py @@ -39,9 +39,9 @@ def partition( class speechCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'long_running_recognize': ('config', 'audio', 'output_config', ), - 'recognize': ('config', 'audio', ), - 'streaming_recognize': ('streaming_config', 'audio_content', ), + 'long_running_recognize': ('config', 'audio', 'output_config', ), + 'recognize': ('config', 'audio', ), + 'streaming_recognize': ('streaming_config', 'audio_content', ), } 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 ) diff --git a/scripts/fixup_speech_v1p1beta1_keywords.py b/scripts/fixup_speech_v1p1beta1_keywords.py index 745c5c1b..a226eb9a 100644 --- a/scripts/fixup_speech_v1p1beta1_keywords.py +++ b/scripts/fixup_speech_v1p1beta1_keywords.py @@ -39,19 +39,19 @@ def partition( class speechCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'create_custom_class': ('parent', 'custom_class_id', 'custom_class', ), - 'create_phrase_set': ('parent', 'phrase_set_id', 'phrase_set', ), - 'delete_custom_class': ('name', ), - 'delete_phrase_set': ('name', ), - 'get_custom_class': ('name', ), - 'get_phrase_set': ('name', ), - 'list_custom_classes': ('parent', 'page_size', 'page_token', ), - 'list_phrase_set': ('parent', 'page_size', 'page_token', ), - 'long_running_recognize': ('config', 'audio', 'output_config', ), - 'recognize': ('config', 'audio', ), - 'streaming_recognize': ('streaming_config', 'audio_content', ), - 'update_custom_class': ('custom_class', 'update_mask', ), - 'update_phrase_set': ('phrase_set', 'update_mask', ), + 'create_custom_class': ('parent', 'custom_class_id', 'custom_class', ), + 'create_phrase_set': ('parent', 'phrase_set_id', 'phrase_set', ), + 'delete_custom_class': ('name', ), + 'delete_phrase_set': ('name', ), + 'get_custom_class': ('name', ), + 'get_phrase_set': ('name', ), + 'list_custom_classes': ('parent', 'page_size', 'page_token', ), + 'list_phrase_set': ('parent', 'page_size', 'page_token', ), + 'long_running_recognize': ('config', 'audio', 'output_config', ), + 'recognize': ('config', 'audio', ), + 'streaming_recognize': ('streaming_config', 'audio_content', ), + 'update_custom_class': ('custom_class', 'update_mask', ), + 'update_phrase_set': ('phrase_set', 'update_mask', ), } def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: @@ -70,7 +70,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 )