From 6387d7c589f7c04f0d832b7976b5fa7d64956d99 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:29 +0000 Subject: [PATCH] chore: use gapic-generator-python 0.51.2 (#31) - [ ] 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/controller2/client.py | 14 ++++++------ .../services/controller2/transports/base.py | 2 +- .../services/controller2/transports/grpc.py | 6 ++--- .../controller2/transports/grpc_asyncio.py | 6 ++--- .../debugger_v2/services/debugger2/client.py | 22 +++++++++---------- .../services/debugger2/transports/base.py | 2 +- .../services/debugger2/transports/grpc.py | 6 ++--- .../debugger2/transports/grpc_asyncio.py | 6 ++--- scripts/fixup_debugger_v2_keywords.py | 18 +++++++-------- 9 files changed, 41 insertions(+), 41 deletions(-) diff --git a/google/cloud/debugger_v2/services/controller2/client.py b/google/cloud/debugger_v2/services/controller2/client.py index 26a711c..6528b1b 100644 --- a/google/cloud/debugger_v2/services/controller2/client.py +++ b/google/cloud/debugger_v2/services/controller2/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 @@ -356,7 +356,7 @@ def __init__( def register_debuggee( self, - request: controller.RegisterDebuggeeRequest = None, + request: Union[controller.RegisterDebuggeeRequest, dict] = None, *, debuggee: data.Debuggee = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -377,7 +377,7 @@ def register_debuggee( re-registration. Args: - request (google.cloud.debugger_v2.types.RegisterDebuggeeRequest): + request (Union[google.cloud.debugger_v2.types.RegisterDebuggeeRequest, dict]): The request object. Request to register a debuggee. debuggee (google.cloud.debugger_v2.types.Debuggee): Required. Debuggee information to register. The fields @@ -430,7 +430,7 @@ def register_debuggee( def list_active_breakpoints( self, - request: controller.ListActiveBreakpointsRequest = None, + request: Union[controller.ListActiveBreakpointsRequest, dict] = None, *, debuggee_id: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -453,7 +453,7 @@ def list_active_breakpoints( from the active list to avoid setting those breakpoints again. Args: - request (google.cloud.debugger_v2.types.ListActiveBreakpointsRequest): + request (Union[google.cloud.debugger_v2.types.ListActiveBreakpointsRequest, dict]): The request object. Request to list active breakpoints. debuggee_id (str): Required. Identifies the debuggee. @@ -505,7 +505,7 @@ def list_active_breakpoints( def update_active_breakpoint( self, - request: controller.UpdateActiveBreakpointRequest = None, + request: Union[controller.UpdateActiveBreakpointRequest, dict] = None, *, debuggee_id: str = None, breakpoint_: data.Breakpoint = None, @@ -524,7 +524,7 @@ def update_active_breakpoint( to the correct line of code. Args: - request (google.cloud.debugger_v2.types.UpdateActiveBreakpointRequest): + request (Union[google.cloud.debugger_v2.types.UpdateActiveBreakpointRequest, dict]): The request object. Request to update an active breakpoint. debuggee_id (str): diff --git a/google/cloud/debugger_v2/services/controller2/transports/base.py b/google/cloud/debugger_v2/services/controller2/transports/base.py index 7d5c88c..ffcdc9c 100644 --- a/google/cloud/debugger_v2/services/controller2/transports/base.py +++ b/google/cloud/debugger_v2/services/controller2/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/google/cloud/debugger_v2/services/controller2/transports/grpc.py b/google/cloud/debugger_v2/services/controller2/transports/grpc.py index d37cfd8..b17fe89 100644 --- a/google/cloud/debugger_v2/services/controller2/transports/grpc.py +++ b/google/cloud/debugger_v2/services/controller2/transports/grpc.py @@ -101,16 +101,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/debugger_v2/services/controller2/transports/grpc_asyncio.py b/google/cloud/debugger_v2/services/controller2/transports/grpc_asyncio.py index 0d97e1a..214a5f2 100644 --- a/google/cloud/debugger_v2/services/controller2/transports/grpc_asyncio.py +++ b/google/cloud/debugger_v2/services/controller2/transports/grpc_asyncio.py @@ -148,16 +148,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/debugger_v2/services/debugger2/client.py b/google/cloud/debugger_v2/services/debugger2/client.py index b8e8a45..9cd0fdf 100644 --- a/google/cloud/debugger_v2/services/debugger2/client.py +++ b/google/cloud/debugger_v2/services/debugger2/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 @@ -347,7 +347,7 @@ def __init__( def set_breakpoint( self, - request: debugger.SetBreakpointRequest = None, + request: Union[debugger.SetBreakpointRequest, dict] = None, *, debuggee_id: str = None, breakpoint_: data.Breakpoint = None, @@ -359,7 +359,7 @@ def set_breakpoint( r"""Sets the breakpoint to the debuggee. Args: - request (google.cloud.debugger_v2.types.SetBreakpointRequest): + request (Union[google.cloud.debugger_v2.types.SetBreakpointRequest, dict]): The request object. Request to set a breakpoint debuggee_id (str): Required. ID of the debuggee where @@ -430,7 +430,7 @@ def set_breakpoint( def get_breakpoint( self, - request: debugger.GetBreakpointRequest = None, + request: Union[debugger.GetBreakpointRequest, dict] = None, *, debuggee_id: str = None, breakpoint_id: str = None, @@ -442,7 +442,7 @@ def get_breakpoint( r"""Gets breakpoint information. Args: - request (google.cloud.debugger_v2.types.GetBreakpointRequest): + request (Union[google.cloud.debugger_v2.types.GetBreakpointRequest, dict]): The request object. Request to get breakpoint information. debuggee_id (str): @@ -516,7 +516,7 @@ def get_breakpoint( def delete_breakpoint( self, - request: debugger.DeleteBreakpointRequest = None, + request: Union[debugger.DeleteBreakpointRequest, dict] = None, *, debuggee_id: str = None, breakpoint_id: str = None, @@ -528,7 +528,7 @@ def delete_breakpoint( r"""Deletes the breakpoint from the debuggee. Args: - request (google.cloud.debugger_v2.types.DeleteBreakpointRequest): + request (Union[google.cloud.debugger_v2.types.DeleteBreakpointRequest, dict]): The request object. Request to delete a breakpoint. debuggee_id (str): Required. ID of the debuggee whose @@ -594,7 +594,7 @@ def delete_breakpoint( def list_breakpoints( self, - request: debugger.ListBreakpointsRequest = None, + request: Union[debugger.ListBreakpointsRequest, dict] = None, *, debuggee_id: str = None, client_version: str = None, @@ -605,7 +605,7 @@ def list_breakpoints( r"""Lists all breakpoints for the debuggee. Args: - request (google.cloud.debugger_v2.types.ListBreakpointsRequest): + request (Union[google.cloud.debugger_v2.types.ListBreakpointsRequest, dict]): The request object. Request to list breakpoints. debuggee_id (str): Required. ID of the debuggee whose @@ -667,7 +667,7 @@ def list_breakpoints( def list_debuggees( self, - request: debugger.ListDebuggeesRequest = None, + request: Union[debugger.ListDebuggeesRequest, dict] = None, *, project: str = None, client_version: str = None, @@ -678,7 +678,7 @@ def list_debuggees( r"""Lists all the debuggees that the user has access to. Args: - request (google.cloud.debugger_v2.types.ListDebuggeesRequest): + request (Union[google.cloud.debugger_v2.types.ListDebuggeesRequest, dict]): The request object. Request to list debuggees. project (str): Required. Project number of a Google diff --git a/google/cloud/debugger_v2/services/debugger2/transports/base.py b/google/cloud/debugger_v2/services/debugger2/transports/base.py index 9e50d47..03adca6 100644 --- a/google/cloud/debugger_v2/services/debugger2/transports/base.py +++ b/google/cloud/debugger_v2/services/debugger2/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/debugger_v2/services/debugger2/transports/grpc.py b/google/cloud/debugger_v2/services/debugger2/transports/grpc.py index c027db7..448a33e 100644 --- a/google/cloud/debugger_v2/services/debugger2/transports/grpc.py +++ b/google/cloud/debugger_v2/services/debugger2/transports/grpc.py @@ -93,16 +93,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/debugger_v2/services/debugger2/transports/grpc_asyncio.py b/google/cloud/debugger_v2/services/debugger2/transports/grpc_asyncio.py index 9a8709b..5145d29 100644 --- a/google/cloud/debugger_v2/services/debugger2/transports/grpc_asyncio.py +++ b/google/cloud/debugger_v2/services/debugger2/transports/grpc_asyncio.py @@ -140,16 +140,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_debugger_v2_keywords.py b/scripts/fixup_debugger_v2_keywords.py index 04fcde2..0f21424 100644 --- a/scripts/fixup_debugger_v2_keywords.py +++ b/scripts/fixup_debugger_v2_keywords.py @@ -39,14 +39,14 @@ def partition( class debuggerCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'delete_breakpoint': ('debuggee_id', 'breakpoint_id', 'client_version', ), - 'get_breakpoint': ('debuggee_id', 'breakpoint_id', 'client_version', ), - 'list_active_breakpoints': ('debuggee_id', 'wait_token', 'success_on_timeout', ), - 'list_breakpoints': ('debuggee_id', 'client_version', 'include_all_users', 'include_inactive', 'action', 'strip_results', 'wait_token', ), - 'list_debuggees': ('project', 'client_version', 'include_inactive', ), - 'register_debuggee': ('debuggee', ), - 'set_breakpoint': ('debuggee_id', 'breakpoint_', 'client_version', ), - 'update_active_breakpoint': ('debuggee_id', 'breakpoint_', ), + 'delete_breakpoint': ('debuggee_id', 'breakpoint_id', 'client_version', ), + 'get_breakpoint': ('debuggee_id', 'breakpoint_id', 'client_version', ), + 'list_active_breakpoints': ('debuggee_id', 'wait_token', 'success_on_timeout', ), + 'list_breakpoints': ('debuggee_id', 'client_version', 'include_all_users', 'include_inactive', 'action', 'strip_results', 'wait_token', ), + 'list_debuggees': ('project', 'client_version', 'include_inactive', ), + 'register_debuggee': ('debuggee', ), + 'set_breakpoint': ('debuggee_id', 'breakpoint_', 'client_version', ), + 'update_active_breakpoint': ('debuggee_id', 'breakpoint_', ), } def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: @@ -65,7 +65,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 )