From b5e0c818eeca22cae59406693f435595d2b92f8d 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:23 +0000 Subject: [PATCH] chore: use gapic-generator-python 0.51.2 (#199) - [ ] 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/secret_manager_service/client.py | 34 +++++++++---------- .../secret_manager_service/transports/base.py | 2 +- .../secret_manager_service/transports/grpc.py | 4 +-- .../transports/grpc_asyncio.py | 4 +-- scripts/fixup_secretmanager_v1_keywords.py | 32 ++++++++--------- 5 files changed, 38 insertions(+), 38 deletions(-) diff --git a/google/cloud/secretmanager_v1/services/secret_manager_service/client.py b/google/cloud/secretmanager_v1/services/secret_manager_service/client.py index 50c17de..a6de513 100644 --- a/google/cloud/secretmanager_v1/services/secret_manager_service/client.py +++ b/google/cloud/secretmanager_v1/services/secret_manager_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 @@ -401,7 +401,7 @@ def list_secrets( r"""Lists [Secrets][google.cloud.secretmanager.v1.Secret]. Args: - request (google.cloud.secretmanager_v1.types.ListSecretsRequest): + request (Union[google.cloud.secretmanager_v1.types.ListSecretsRequest, dict]): The request object. Request message for [SecretManagerService.ListSecrets][google.cloud.secretmanager.v1.SecretManagerService.ListSecrets]. parent (str): @@ -487,7 +487,7 @@ def create_secret( [SecretVersions][google.cloud.secretmanager.v1.SecretVersion]. Args: - request (google.cloud.secretmanager_v1.types.CreateSecretRequest): + request (Union[google.cloud.secretmanager_v1.types.CreateSecretRequest, dict]): The request object. Request message for [SecretManagerService.CreateSecret][google.cloud.secretmanager.v1.SecretManagerService.CreateSecret]. parent (str): @@ -591,7 +591,7 @@ def add_secret_version( [Secret][google.cloud.secretmanager.v1.Secret]. Args: - request (google.cloud.secretmanager_v1.types.AddSecretVersionRequest): + request (Union[google.cloud.secretmanager_v1.types.AddSecretVersionRequest, dict]): The request object. Request message for [SecretManagerService.AddSecretVersion][google.cloud.secretmanager.v1.SecretManagerService.AddSecretVersion]. parent (str): @@ -675,7 +675,7 @@ def get_secret( [Secret][google.cloud.secretmanager.v1.Secret]. Args: - request (google.cloud.secretmanager_v1.types.GetSecretRequest): + request (Union[google.cloud.secretmanager_v1.types.GetSecretRequest, dict]): The request object. Request message for [SecretManagerService.GetSecret][google.cloud.secretmanager.v1.SecretManagerService.GetSecret]. name (str): @@ -742,7 +742,7 @@ def get_secret( def update_secret( self, - request: service.UpdateSecretRequest = None, + request: Union[service.UpdateSecretRequest, dict] = None, *, secret: resources.Secret = None, update_mask: field_mask_pb2.FieldMask = None, @@ -754,7 +754,7 @@ def update_secret( [Secret][google.cloud.secretmanager.v1.Secret]. Args: - request (google.cloud.secretmanager_v1.types.UpdateSecretRequest): + request (Union[google.cloud.secretmanager_v1.types.UpdateSecretRequest, dict]): The request object. Request message for [SecretManagerService.UpdateSecret][google.cloud.secretmanager.v1.SecretManagerService.UpdateSecret]. secret (google.cloud.secretmanager_v1.types.Secret): @@ -841,7 +841,7 @@ def delete_secret( r"""Deletes a [Secret][google.cloud.secretmanager.v1.Secret]. Args: - request (google.cloud.secretmanager_v1.types.DeleteSecretRequest): + request (Union[google.cloud.secretmanager_v1.types.DeleteSecretRequest, dict]): The request object. Request message for [SecretManagerService.DeleteSecret][google.cloud.secretmanager.v1.SecretManagerService.DeleteSecret]. name (str): @@ -908,7 +908,7 @@ def list_secret_versions( This call does not return secret data. Args: - request (google.cloud.secretmanager_v1.types.ListSecretVersionsRequest): + request (Union[google.cloud.secretmanager_v1.types.ListSecretVersionsRequest, dict]): The request object. Request message for [SecretManagerService.ListSecretVersions][google.cloud.secretmanager.v1.SecretManagerService.ListSecretVersions]. parent (str): @@ -996,7 +996,7 @@ def get_secret_version( [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Args: - request (google.cloud.secretmanager_v1.types.GetSecretVersionRequest): + request (Union[google.cloud.secretmanager_v1.types.GetSecretVersionRequest, dict]): The request object. Request message for [SecretManagerService.GetSecretVersion][google.cloud.secretmanager.v1.SecretManagerService.GetSecretVersion]. name (str): @@ -1078,7 +1078,7 @@ def access_secret_version( [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Args: - request (google.cloud.secretmanager_v1.types.AccessSecretVersionRequest): + request (Union[google.cloud.secretmanager_v1.types.AccessSecretVersionRequest, dict]): The request object. Request message for [SecretManagerService.AccessSecretVersion][google.cloud.secretmanager.v1.SecretManagerService.AccessSecretVersion]. name (str): @@ -1161,7 +1161,7 @@ def disable_secret_version( [DISABLED][google.cloud.secretmanager.v1.SecretVersion.State.DISABLED]. Args: - request (google.cloud.secretmanager_v1.types.DisableSecretVersionRequest): + request (Union[google.cloud.secretmanager_v1.types.DisableSecretVersionRequest, dict]): The request object. Request message for [SecretManagerService.DisableSecretVersion][google.cloud.secretmanager.v1.SecretManagerService.DisableSecretVersion]. name (str): @@ -1241,7 +1241,7 @@ def enable_secret_version( [ENABLED][google.cloud.secretmanager.v1.SecretVersion.State.ENABLED]. Args: - request (google.cloud.secretmanager_v1.types.EnableSecretVersionRequest): + request (Union[google.cloud.secretmanager_v1.types.EnableSecretVersionRequest, dict]): The request object. Request message for [SecretManagerService.EnableSecretVersion][google.cloud.secretmanager.v1.SecretManagerService.EnableSecretVersion]. name (str): @@ -1322,7 +1322,7 @@ def destroy_secret_version( and irrevocably destroys the secret data. Args: - request (google.cloud.secretmanager_v1.types.DestroySecretVersionRequest): + request (Union[google.cloud.secretmanager_v1.types.DestroySecretVersionRequest, dict]): The request object. Request message for [SecretManagerService.DestroySecretVersion][google.cloud.secretmanager.v1.SecretManagerService.DestroySecretVersion]. name (str): @@ -1400,7 +1400,7 @@ def set_iam_policy( [Secret][google.cloud.secretmanager.v1.Secret]. Args: - request (google.iam.v1.iam_policy_pb2.SetIamPolicyRequest): + request (Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]): The request object. Request message for `SetIamPolicy` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1506,7 +1506,7 @@ def get_iam_policy( have a policy set. Args: - request (google.iam.v1.iam_policy_pb2.GetIamPolicyRequest): + request (Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]): The request object. Request message for `GetIamPolicy` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1617,7 +1617,7 @@ def test_iam_permissions( warning. Args: - request (google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest): + request (Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]): The request object. Request message for `TestIamPermissions` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, diff --git a/google/cloud/secretmanager_v1/services/secret_manager_service/transports/base.py b/google/cloud/secretmanager_v1/services/secret_manager_service/transports/base.py index ec19bfd..7ec7430 100644 --- a/google/cloud/secretmanager_v1/services/secret_manager_service/transports/base.py +++ b/google/cloud/secretmanager_v1/services/secret_manager_service/transports/base.py @@ -121,7 +121,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/secretmanager_v1/services/secret_manager_service/transports/grpc.py b/google/cloud/secretmanager_v1/services/secret_manager_service/transports/grpc.py index 624903e..627cb53 100644 --- a/google/cloud/secretmanager_v1/services/secret_manager_service/transports/grpc.py +++ b/google/cloud/secretmanager_v1/services/secret_manager_service/transports/grpc.py @@ -96,10 +96,10 @@ def __init__( 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/secretmanager_v1/services/secret_manager_service/transports/grpc_asyncio.py b/google/cloud/secretmanager_v1/services/secret_manager_service/transports/grpc_asyncio.py index cd70a72..64905b7 100644 --- a/google/cloud/secretmanager_v1/services/secret_manager_service/transports/grpc_asyncio.py +++ b/google/cloud/secretmanager_v1/services/secret_manager_service/transports/grpc_asyncio.py @@ -143,10 +143,10 @@ def __init__( 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_secretmanager_v1_keywords.py b/scripts/fixup_secretmanager_v1_keywords.py index e8e12e1..1f5e1da 100644 --- a/scripts/fixup_secretmanager_v1_keywords.py +++ b/scripts/fixup_secretmanager_v1_keywords.py @@ -39,21 +39,21 @@ def partition( class secretmanagerCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'access_secret_version': ('name', ), - 'add_secret_version': ('parent', 'payload', ), - 'create_secret': ('parent', 'secret_id', 'secret', ), - 'delete_secret': ('name', 'etag', ), - 'destroy_secret_version': ('name', 'etag', ), - 'disable_secret_version': ('name', 'etag', ), - 'enable_secret_version': ('name', 'etag', ), - 'get_iam_policy': ('resource', 'options', ), - 'get_secret': ('name', ), - 'get_secret_version': ('name', ), - 'list_secrets': ('parent', 'page_size', 'page_token', 'filter', ), - 'list_secret_versions': ('parent', 'page_size', 'page_token', 'filter', ), - 'set_iam_policy': ('resource', 'policy', ), - 'test_iam_permissions': ('resource', 'permissions', ), - 'update_secret': ('secret', 'update_mask', ), + 'access_secret_version': ('name', ), + 'add_secret_version': ('parent', 'payload', ), + 'create_secret': ('parent', 'secret_id', 'secret', ), + 'delete_secret': ('name', 'etag', ), + 'destroy_secret_version': ('name', 'etag', ), + 'disable_secret_version': ('name', 'etag', ), + 'enable_secret_version': ('name', 'etag', ), + 'get_iam_policy': ('resource', 'options', ), + 'get_secret': ('name', ), + 'get_secret_version': ('name', ), + 'list_secrets': ('parent', 'page_size', 'page_token', 'filter', ), + 'list_secret_versions': ('parent', 'page_size', 'page_token', 'filter', ), + 'set_iam_policy': ('resource', 'policy', ), + 'test_iam_permissions': ('resource', 'permissions', ), + 'update_secret': ('secret', 'update_mask', ), } def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: @@ -72,7 +72,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 )