From 5d92970063b5d1cb8291fa20dc906bd2c6d41e49 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:08:21 +0000 Subject: [PATCH] chore: use gapic-generator-python 0.51.2 (#117) - [ ] 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/os_login_service/client.py | 26 +++++++++---------- .../os_login_service/transports/base.py | 2 +- .../os_login_service/transports/grpc.py | 6 ++--- .../transports/grpc_asyncio.py | 6 ++--- .../scripts/fixup_oslogin_v1_keywords.py | 14 +++++----- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/packages/google-cloud-os-login/google/cloud/oslogin_v1/services/os_login_service/client.py b/packages/google-cloud-os-login/google/cloud/oslogin_v1/services/os_login_service/client.py index 64d3bf34fa43..651a5ec23c33 100644 --- a/packages/google-cloud-os-login/google/cloud/oslogin_v1/services/os_login_service/client.py +++ b/packages/google-cloud-os-login/google/cloud/oslogin_v1/services/os_login_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 @@ -365,7 +365,7 @@ def __init__( def delete_posix_account( self, - request: oslogin.DeletePosixAccountRequest = None, + request: Union[oslogin.DeletePosixAccountRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -375,7 +375,7 @@ def delete_posix_account( r"""Deletes a POSIX account. Args: - request (google.cloud.oslogin_v1.types.DeletePosixAccountRequest): + request (Union[google.cloud.oslogin_v1.types.DeletePosixAccountRequest, dict]): The request object. A request message for deleting a POSIX account entry. name (str): @@ -431,7 +431,7 @@ def delete_posix_account( def delete_ssh_public_key( self, - request: oslogin.DeleteSshPublicKeyRequest = None, + request: Union[oslogin.DeleteSshPublicKeyRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -441,7 +441,7 @@ def delete_ssh_public_key( r"""Deletes an SSH public key. Args: - request (google.cloud.oslogin_v1.types.DeleteSshPublicKeyRequest): + request (Union[google.cloud.oslogin_v1.types.DeleteSshPublicKeyRequest, dict]): The request object. A request message for deleting an SSH public key. name (str): @@ -497,7 +497,7 @@ def delete_ssh_public_key( def get_login_profile( self, - request: oslogin.GetLoginProfileRequest = None, + request: Union[oslogin.GetLoginProfileRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -508,7 +508,7 @@ def get_login_profile( to a virtual machine on Google Compute Engine. Args: - request (google.cloud.oslogin_v1.types.GetLoginProfileRequest): + request (Union[google.cloud.oslogin_v1.types.GetLoginProfileRequest, dict]): The request object. A request message for retrieving the login profile information for a user. name (str): @@ -570,7 +570,7 @@ def get_login_profile( def get_ssh_public_key( self, - request: oslogin.GetSshPublicKeyRequest = None, + request: Union[oslogin.GetSshPublicKeyRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -580,7 +580,7 @@ def get_ssh_public_key( r"""Retrieves an SSH public key. Args: - request (google.cloud.oslogin_v1.types.GetSshPublicKeyRequest): + request (Union[google.cloud.oslogin_v1.types.GetSshPublicKeyRequest, dict]): The request object. A request message for retrieving an SSH public key. name (str): @@ -643,7 +643,7 @@ def get_ssh_public_key( def import_ssh_public_key( self, - request: oslogin.ImportSshPublicKeyRequest = None, + request: Union[oslogin.ImportSshPublicKeyRequest, dict] = None, *, parent: str = None, ssh_public_key: common.SshPublicKey = None, @@ -658,7 +658,7 @@ def import_ssh_public_key( profile. Args: - request (google.cloud.oslogin_v1.types.ImportSshPublicKeyRequest): + request (Union[google.cloud.oslogin_v1.types.ImportSshPublicKeyRequest, dict]): The request object. A request message for importing an SSH public key. parent (str): @@ -737,7 +737,7 @@ def import_ssh_public_key( def update_ssh_public_key( self, - request: oslogin.UpdateSshPublicKeyRequest = None, + request: Union[oslogin.UpdateSshPublicKeyRequest, dict] = None, *, name: str = None, ssh_public_key: common.SshPublicKey = None, @@ -750,7 +750,7 @@ def update_ssh_public_key( information. This method supports patch semantics. Args: - request (google.cloud.oslogin_v1.types.UpdateSshPublicKeyRequest): + request (Union[google.cloud.oslogin_v1.types.UpdateSshPublicKeyRequest, dict]): The request object. A request message for updating an SSH public key. name (str): diff --git a/packages/google-cloud-os-login/google/cloud/oslogin_v1/services/os_login_service/transports/base.py b/packages/google-cloud-os-login/google/cloud/oslogin_v1/services/os_login_service/transports/base.py index fbe388356d00..d1eb61657bae 100644 --- a/packages/google-cloud-os-login/google/cloud/oslogin_v1/services/os_login_service/transports/base.py +++ b/packages/google-cloud-os-login/google/cloud/oslogin_v1/services/os_login_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/packages/google-cloud-os-login/google/cloud/oslogin_v1/services/os_login_service/transports/grpc.py b/packages/google-cloud-os-login/google/cloud/oslogin_v1/services/os_login_service/transports/grpc.py index 2e1e95763910..08fc3d9fce51 100644 --- a/packages/google-cloud-os-login/google/cloud/oslogin_v1/services/os_login_service/transports/grpc.py +++ b/packages/google-cloud-os-login/google/cloud/oslogin_v1/services/os_login_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/packages/google-cloud-os-login/google/cloud/oslogin_v1/services/os_login_service/transports/grpc_asyncio.py b/packages/google-cloud-os-login/google/cloud/oslogin_v1/services/os_login_service/transports/grpc_asyncio.py index c201232c5f08..32fbbb97d57b 100644 --- a/packages/google-cloud-os-login/google/cloud/oslogin_v1/services/os_login_service/transports/grpc_asyncio.py +++ b/packages/google-cloud-os-login/google/cloud/oslogin_v1/services/os_login_service/transports/grpc_asyncio.py @@ -132,16 +132,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/packages/google-cloud-os-login/scripts/fixup_oslogin_v1_keywords.py b/packages/google-cloud-os-login/scripts/fixup_oslogin_v1_keywords.py index ac0907211f80..a5181c481a86 100644 --- a/packages/google-cloud-os-login/scripts/fixup_oslogin_v1_keywords.py +++ b/packages/google-cloud-os-login/scripts/fixup_oslogin_v1_keywords.py @@ -39,12 +39,12 @@ def partition( class osloginCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'delete_posix_account': ('name', ), - 'delete_ssh_public_key': ('name', ), - 'get_login_profile': ('name', 'project_id', 'system_id', ), - 'get_ssh_public_key': ('name', ), - 'import_ssh_public_key': ('parent', 'ssh_public_key', 'project_id', ), - 'update_ssh_public_key': ('name', 'ssh_public_key', 'update_mask', ), + 'delete_posix_account': ('name', ), + 'delete_ssh_public_key': ('name', ), + 'get_login_profile': ('name', 'project_id', 'system_id', ), + 'get_ssh_public_key': ('name', ), + 'import_ssh_public_key': ('parent', 'ssh_public_key', 'project_id', ), + 'update_ssh_public_key': ('name', 'ssh_public_key', 'update_mask', ), } def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: @@ -63,7 +63,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 )