From 107b7cbce5a3ecd84519aa1fdffe8bcdd07e2a3e 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:10:54 +0000 Subject: [PATCH] chore: use gapic-generator-python 0.51.2 (#42) - [ ] 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/resource_settings_service/client.py | 14 +++++++------- .../resource_settings_service/transports/base.py | 2 +- .../resource_settings_service/transports/grpc.py | 6 +++--- .../transports/grpc_asyncio.py | 6 +++--- .../scripts/fixup_resourcesettings_v1_keywords.py | 8 ++++---- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/google-cloud-resource-settings/google/cloud/resourcesettings_v1/services/resource_settings_service/client.py b/packages/google-cloud-resource-settings/google/cloud/resourcesettings_v1/services/resource_settings_service/client.py index 26f04dec7992..071a208b5606 100644 --- a/packages/google-cloud-resource-settings/google/cloud/resourcesettings_v1/services/resource_settings_service/client.py +++ b/packages/google-cloud-resource-settings/google/cloud/resourcesettings_v1/services/resource_settings_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 @@ -366,7 +366,7 @@ def __init__( def list_settings( self, - request: resource_settings.ListSettingsRequest = None, + request: Union[resource_settings.ListSettingsRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -377,7 +377,7 @@ def list_settings( ``parent``. Args: - request (google.cloud.resourcesettings_v1.types.ListSettingsRequest): + request (Union[google.cloud.resourcesettings_v1.types.ListSettingsRequest, dict]): The request object. The request for ListSettings. parent (str): Required. The Cloud resource that parents the setting. @@ -450,7 +450,7 @@ def list_settings( def get_setting( self, - request: resource_settings.GetSettingRequest = None, + request: Union[resource_settings.GetSettingRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -463,7 +463,7 @@ def get_setting( ``google.rpc.Code.NOT_FOUND`` if the setting does not exist. Args: - request (google.cloud.resourcesettings_v1.types.GetSettingRequest): + request (Union[google.cloud.resourcesettings_v1.types.GetSettingRequest, dict]): The request object. The request for GetSetting. name (str): Required. The name of the setting to get. See @@ -522,7 +522,7 @@ def get_setting( def update_setting( self, - request: resource_settings.UpdateSettingRequest = None, + request: Union[resource_settings.UpdateSettingRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -546,7 +546,7 @@ def update_setting( ``local_value`` field. Args: - request (google.cloud.resourcesettings_v1.types.UpdateSettingRequest): + request (Union[google.cloud.resourcesettings_v1.types.UpdateSettingRequest, dict]): The request object. The request for UpdateSetting. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. diff --git a/packages/google-cloud-resource-settings/google/cloud/resourcesettings_v1/services/resource_settings_service/transports/base.py b/packages/google-cloud-resource-settings/google/cloud/resourcesettings_v1/services/resource_settings_service/transports/base.py index 3210e5ece684..f5cc17de660b 100644 --- a/packages/google-cloud-resource-settings/google/cloud/resourcesettings_v1/services/resource_settings_service/transports/base.py +++ b/packages/google-cloud-resource-settings/google/cloud/resourcesettings_v1/services/resource_settings_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/packages/google-cloud-resource-settings/google/cloud/resourcesettings_v1/services/resource_settings_service/transports/grpc.py b/packages/google-cloud-resource-settings/google/cloud/resourcesettings_v1/services/resource_settings_service/transports/grpc.py index e7ad163de071..0400eec0654b 100644 --- a/packages/google-cloud-resource-settings/google/cloud/resourcesettings_v1/services/resource_settings_service/transports/grpc.py +++ b/packages/google-cloud-resource-settings/google/cloud/resourcesettings_v1/services/resource_settings_service/transports/grpc.py @@ -92,16 +92,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-resource-settings/google/cloud/resourcesettings_v1/services/resource_settings_service/transports/grpc_asyncio.py b/packages/google-cloud-resource-settings/google/cloud/resourcesettings_v1/services/resource_settings_service/transports/grpc_asyncio.py index cacec1884644..fd6d204be4a0 100644 --- a/packages/google-cloud-resource-settings/google/cloud/resourcesettings_v1/services/resource_settings_service/transports/grpc_asyncio.py +++ b/packages/google-cloud-resource-settings/google/cloud/resourcesettings_v1/services/resource_settings_service/transports/grpc_asyncio.py @@ -139,16 +139,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-resource-settings/scripts/fixup_resourcesettings_v1_keywords.py b/packages/google-cloud-resource-settings/scripts/fixup_resourcesettings_v1_keywords.py index 24da12652955..b1c0002593ee 100644 --- a/packages/google-cloud-resource-settings/scripts/fixup_resourcesettings_v1_keywords.py +++ b/packages/google-cloud-resource-settings/scripts/fixup_resourcesettings_v1_keywords.py @@ -39,9 +39,9 @@ def partition( class resourcesettingsCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'get_setting': ('name', 'view', ), - 'list_settings': ('parent', 'page_size', 'page_token', 'view', ), - 'update_setting': ('setting', ), + 'get_setting': ('name', 'view', ), + 'list_settings': ('parent', 'page_size', 'page_token', 'view', ), + 'update_setting': ('setting', ), } 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 )