From c07f6c900b41a7513fa73a36544f62d429d1a36d 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:08:16 +0000 Subject: [PATCH] chore: use gapic-generator-python 0.51.2 (#37) - [ ] 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/cloud_shell_service/client.py | 22 +++++++++---------- .../cloud_shell_service/transports/base.py | 2 +- .../cloud_shell_service/transports/grpc.py | 6 ++--- .../transports/grpc_asyncio.py | 6 ++--- scripts/fixup_shell_v1_keywords.py | 12 +++++----- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/google/cloud/shell_v1/services/cloud_shell_service/client.py b/google/cloud/shell_v1/services/cloud_shell_service/client.py index 6696615..747084d 100644 --- a/google/cloud/shell_v1/services/cloud_shell_service/client.py +++ b/google/cloud/shell_v1/services/cloud_shell_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 @@ -360,7 +360,7 @@ def __init__( def get_environment( self, - request: cloudshell.GetEnvironmentRequest = None, + request: Union[cloudshell.GetEnvironmentRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -371,7 +371,7 @@ def get_environment( not exist. Args: - request (google.cloud.shell_v1.types.GetEnvironmentRequest): + request (Union[google.cloud.shell_v1.types.GetEnvironmentRequest, dict]): The request object. Request message for [GetEnvironment][google.cloud.shell.v1.CloudShellService.GetEnvironment]. name (str): @@ -439,7 +439,7 @@ def get_environment( def start_environment( self, - request: cloudshell.StartEnvironmentRequest = None, + request: Union[cloudshell.StartEnvironmentRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -455,7 +455,7 @@ def start_environment( StartEnvironmentResponse in its response field. Args: - request (google.cloud.shell_v1.types.StartEnvironmentRequest): + request (Union[google.cloud.shell_v1.types.StartEnvironmentRequest, dict]): The request object. Request message for [StartEnvironment][google.cloud.shell.v1.CloudShellService.StartEnvironment]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -507,7 +507,7 @@ def start_environment( def authorize_environment( self, - request: cloudshell.AuthorizeEnvironmentRequest = None, + request: Union[cloudshell.AuthorizeEnvironmentRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -520,7 +520,7 @@ def authorize_environment( authenticate. Args: - request (google.cloud.shell_v1.types.AuthorizeEnvironmentRequest): + request (Union[google.cloud.shell_v1.types.AuthorizeEnvironmentRequest, dict]): The request object. Request message for [AuthorizeEnvironment][google.cloud.shell.v1.CloudShellService.AuthorizeEnvironment]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -571,7 +571,7 @@ def authorize_environment( def add_public_key( self, - request: cloudshell.AddPublicKeyRequest = None, + request: Union[cloudshell.AddPublicKeyRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -583,7 +583,7 @@ def add_public_key( error with ALREADY_EXISTS. Args: - request (google.cloud.shell_v1.types.AddPublicKeyRequest): + request (Union[google.cloud.shell_v1.types.AddPublicKeyRequest, dict]): The request object. Request message for [AddPublicKey][google.cloud.shell.v1.CloudShellService.AddPublicKey]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -636,7 +636,7 @@ def add_public_key( def remove_public_key( self, - request: cloudshell.RemovePublicKeyRequest = None, + request: Union[cloudshell.RemovePublicKeyRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -648,7 +648,7 @@ def remove_public_key( present, this will error with NOT_FOUND. Args: - request (google.cloud.shell_v1.types.RemovePublicKeyRequest): + request (Union[google.cloud.shell_v1.types.RemovePublicKeyRequest, dict]): The request object. Request message for [RemovePublicKey][google.cloud.shell.v1.CloudShellService.RemovePublicKey]. retry (google.api_core.retry.Retry): Designation of what errors, if any, diff --git a/google/cloud/shell_v1/services/cloud_shell_service/transports/base.py b/google/cloud/shell_v1/services/cloud_shell_service/transports/base.py index b1a6fb2..1576c90 100644 --- a/google/cloud/shell_v1/services/cloud_shell_service/transports/base.py +++ b/google/cloud/shell_v1/services/cloud_shell_service/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/shell_v1/services/cloud_shell_service/transports/grpc.py b/google/cloud/shell_v1/services/cloud_shell_service/transports/grpc.py index 33b7b09..22f9e83 100644 --- a/google/cloud/shell_v1/services/cloud_shell_service/transports/grpc.py +++ b/google/cloud/shell_v1/services/cloud_shell_service/transports/grpc.py @@ -89,16 +89,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/shell_v1/services/cloud_shell_service/transports/grpc_asyncio.py b/google/cloud/shell_v1/services/cloud_shell_service/transports/grpc_asyncio.py index ba99aa2..8878f21 100644 --- a/google/cloud/shell_v1/services/cloud_shell_service/transports/grpc_asyncio.py +++ b/google/cloud/shell_v1/services/cloud_shell_service/transports/grpc_asyncio.py @@ -136,16 +136,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_shell_v1_keywords.py b/scripts/fixup_shell_v1_keywords.py index c4b2aa4..b5196e2 100644 --- a/scripts/fixup_shell_v1_keywords.py +++ b/scripts/fixup_shell_v1_keywords.py @@ -39,11 +39,11 @@ def partition( class shellCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'add_public_key': ('environment', 'key', ), - 'authorize_environment': ('name', 'access_token', 'id_token', 'expire_time', ), - 'get_environment': ('name', ), - 'remove_public_key': ('environment', 'key', ), - 'start_environment': ('name', 'access_token', 'public_keys', ), + 'add_public_key': ('environment', 'key', ), + 'authorize_environment': ('name', 'access_token', 'id_token', 'expire_time', ), + 'get_environment': ('name', ), + 'remove_public_key': ('environment', 'key', ), + 'start_environment': ('name', 'access_token', 'public_keys', ), } def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: @@ -62,7 +62,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 )