diff --git a/google/cloud/bigquery_connection_v1/services/connection_service/client.py b/google/cloud/bigquery_connection_v1/services/connection_service/client.py index 0f818a7..61dec54 100644 --- a/google/cloud/bigquery_connection_v1/services/connection_service/client.py +++ b/google/cloud/bigquery_connection_v1/services/connection_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 @@ -358,7 +358,7 @@ def __init__( def create_connection( self, - request: gcbc_connection.CreateConnectionRequest = None, + request: Union[gcbc_connection.CreateConnectionRequest, dict] = None, *, parent: str = None, connection: gcbc_connection.Connection = None, @@ -370,7 +370,7 @@ def create_connection( r"""Creates a new connection. Args: - request (google.cloud.bigquery_connection_v1.types.CreateConnectionRequest): + request (Union[google.cloud.bigquery_connection_v1.types.CreateConnectionRequest, dict]): The request object. The request for [ConnectionService.CreateConnection][google.cloud.bigquery.connection.v1.ConnectionService.CreateConnection]. parent (str): @@ -448,7 +448,7 @@ def create_connection( def get_connection( self, - request: connection.GetConnectionRequest = None, + request: Union[connection.GetConnectionRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -458,7 +458,7 @@ def get_connection( r"""Returns specified connection. Args: - request (google.cloud.bigquery_connection_v1.types.GetConnectionRequest): + request (Union[google.cloud.bigquery_connection_v1.types.GetConnectionRequest, dict]): The request object. The request for [ConnectionService.GetConnection][google.cloud.bigquery.connection.v1.ConnectionService.GetConnection]. name (str): @@ -520,7 +520,7 @@ def get_connection( def list_connections( self, - request: connection.ListConnectionsRequest = None, + request: Union[connection.ListConnectionsRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -530,7 +530,7 @@ def list_connections( r"""Returns a list of connections in the given project. Args: - request (google.cloud.bigquery_connection_v1.types.ListConnectionsRequest): + request (Union[google.cloud.bigquery_connection_v1.types.ListConnectionsRequest, dict]): The request object. The request for [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1.ConnectionService.ListConnections]. parent (str): @@ -600,7 +600,7 @@ def list_connections( def update_connection( self, - request: gcbc_connection.UpdateConnectionRequest = None, + request: Union[gcbc_connection.UpdateConnectionRequest, dict] = None, *, name: str = None, connection: gcbc_connection.Connection = None, @@ -614,7 +614,7 @@ def update_connection( are in the update field mask. Args: - request (google.cloud.bigquery_connection_v1.types.UpdateConnectionRequest): + request (Union[google.cloud.bigquery_connection_v1.types.UpdateConnectionRequest, dict]): The request object. The request for [ConnectionService.UpdateConnection][google.cloud.bigquery.connection.v1.ConnectionService.UpdateConnection]. name (str): @@ -694,7 +694,7 @@ def update_connection( def delete_connection( self, - request: connection.DeleteConnectionRequest = None, + request: Union[connection.DeleteConnectionRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -704,7 +704,7 @@ def delete_connection( r"""Deletes connection and associated credential. Args: - request (google.cloud.bigquery_connection_v1.types.DeleteConnectionRequest): + request (Union[google.cloud.bigquery_connection_v1.types.DeleteConnectionRequest, dict]): The request object. The request for [ConnectionService.DeleteConnectionRequest][]. name (str): @@ -758,7 +758,7 @@ def delete_connection( def get_iam_policy( self, - request: iam_policy_pb2.GetIamPolicyRequest = None, + request: Union[iam_policy_pb2.GetIamPolicyRequest, dict] = None, *, resource: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -770,7 +770,7 @@ def get_iam_policy( not 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. resource (str): @@ -885,7 +885,7 @@ def get_iam_policy( def set_iam_policy( self, - request: iam_policy_pb2.SetIamPolicyRequest = None, + request: Union[iam_policy_pb2.SetIamPolicyRequest, dict] = None, *, resource: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -899,7 +899,7 @@ def set_iam_policy( ``PERMISSION_DENIED`` errors. 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. resource (str): @@ -1014,7 +1014,7 @@ def set_iam_policy( def test_iam_permissions( self, - request: iam_policy_pb2.TestIamPermissionsRequest = None, + request: Union[iam_policy_pb2.TestIamPermissionsRequest, dict] = None, *, resource: str = None, permissions: Sequence[str] = None, @@ -1032,7 +1032,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. resource (str): diff --git a/google/cloud/bigquery_connection_v1/services/connection_service/transports/base.py b/google/cloud/bigquery_connection_v1/services/connection_service/transports/base.py index 8cd1907..7f5c9be 100644 --- a/google/cloud/bigquery_connection_v1/services/connection_service/transports/base.py +++ b/google/cloud/bigquery_connection_v1/services/connection_service/transports/base.py @@ -124,7 +124,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/bigquery_connection_v1/services/connection_service/transports/grpc.py b/google/cloud/bigquery_connection_v1/services/connection_service/transports/grpc.py index d682bbe..1724f74 100644 --- a/google/cloud/bigquery_connection_v1/services/connection_service/transports/grpc.py +++ b/google/cloud/bigquery_connection_v1/services/connection_service/transports/grpc.py @@ -84,16 +84,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/bigquery_connection_v1/services/connection_service/transports/grpc_asyncio.py b/google/cloud/bigquery_connection_v1/services/connection_service/transports/grpc_asyncio.py index 30c794e..20d3be2 100644 --- a/google/cloud/bigquery_connection_v1/services/connection_service/transports/grpc_asyncio.py +++ b/google/cloud/bigquery_connection_v1/services/connection_service/transports/grpc_asyncio.py @@ -131,16 +131,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_bigquery_connection_v1_keywords.py b/scripts/fixup_bigquery_connection_v1_keywords.py index 9276ace..8693120 100644 --- a/scripts/fixup_bigquery_connection_v1_keywords.py +++ b/scripts/fixup_bigquery_connection_v1_keywords.py @@ -39,14 +39,14 @@ def partition( class bigquery_connectionCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'create_connection': ('parent', 'connection', 'connection_id', ), - 'delete_connection': ('name', ), - 'get_connection': ('name', ), - 'get_iam_policy': ('resource', 'options', ), - 'list_connections': ('parent', 'page_size', 'page_token', ), - 'set_iam_policy': ('resource', 'policy', ), - 'test_iam_permissions': ('resource', 'permissions', ), - 'update_connection': ('name', 'connection', 'update_mask', ), + 'create_connection': ('parent', 'connection', 'connection_id', ), + 'delete_connection': ('name', ), + 'get_connection': ('name', ), + 'get_iam_policy': ('resource', 'options', ), + 'list_connections': ('parent', 'page_size', 'page_token', ), + 'set_iam_policy': ('resource', 'policy', ), + 'test_iam_permissions': ('resource', 'permissions', ), + 'update_connection': ('name', 'connection', 'update_mask', ), } 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 )