From d58581710d28f836ba1c3be16b55df1f213d0bc0 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:14:27 +0000 Subject: [PATCH] chore: use gapic-generator-python 0.51.2 (#222) - [ ] 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/data_transfer_service/client.py | 58 +++++++++---------- .../data_transfer_service/transports/base.py | 2 +- .../data_transfer_service/transports/grpc.py | 6 +- .../transports/grpc_asyncio.py | 6 +- ...fixup_bigquery_datatransfer_v1_keywords.py | 30 +++++----- 5 files changed, 51 insertions(+), 51 deletions(-) diff --git a/packages/google-cloud-bigquery-datatransfer/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/client.py b/packages/google-cloud-bigquery-datatransfer/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/client.py index e735a19d96a6..3f86cb3abf25 100644 --- a/packages/google-cloud-bigquery-datatransfer/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/client.py +++ b/packages/google-cloud-bigquery-datatransfer/google/cloud/bigquery_datatransfer_v1/services/data_transfer_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 import warnings @@ -396,7 +396,7 @@ def __init__( def get_data_source( self, - request: datatransfer.GetDataSourceRequest = None, + request: Union[datatransfer.GetDataSourceRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -407,7 +407,7 @@ def get_data_source( settings, which can be used for UI rendering. Args: - request (google.cloud.bigquery_datatransfer_v1.types.GetDataSourceRequest): + request (Union[google.cloud.bigquery_datatransfer_v1.types.GetDataSourceRequest, dict]): The request object. A request to get data source info. name (str): Required. The field will contain name of the resource @@ -471,7 +471,7 @@ def get_data_source( def list_data_sources( self, - request: datatransfer.ListDataSourcesRequest = None, + request: Union[datatransfer.ListDataSourcesRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -482,7 +482,7 @@ def list_data_sources( settings, which can be used for UI rendering. Args: - request (google.cloud.bigquery_datatransfer_v1.types.ListDataSourcesRequest): + request (Union[google.cloud.bigquery_datatransfer_v1.types.ListDataSourcesRequest, dict]): The request object. Request to list supported data sources and their data transfer settings. parent (str): @@ -554,7 +554,7 @@ def list_data_sources( def create_transfer_config( self, - request: datatransfer.CreateTransferConfigRequest = None, + request: Union[datatransfer.CreateTransferConfigRequest, dict] = None, *, parent: str = None, transfer_config: transfer.TransferConfig = None, @@ -565,7 +565,7 @@ def create_transfer_config( r"""Creates a new data transfer configuration. Args: - request (google.cloud.bigquery_datatransfer_v1.types.CreateTransferConfigRequest): + request (Union[google.cloud.bigquery_datatransfer_v1.types.CreateTransferConfigRequest, dict]): The request object. A request to create a data transfer configuration. If new credentials are needed for this transfer configuration, an authorization code must be @@ -651,7 +651,7 @@ def create_transfer_config( def update_transfer_config( self, - request: datatransfer.UpdateTransferConfigRequest = None, + request: Union[datatransfer.UpdateTransferConfigRequest, dict] = None, *, transfer_config: transfer.TransferConfig = None, update_mask: field_mask_pb2.FieldMask = None, @@ -663,7 +663,7 @@ def update_transfer_config( All fields must be set, even if they are not updated. Args: - request (google.cloud.bigquery_datatransfer_v1.types.UpdateTransferConfigRequest): + request (Union[google.cloud.bigquery_datatransfer_v1.types.UpdateTransferConfigRequest, dict]): The request object. A request to update a transfer configuration. To update the user id of the transfer configuration, an authorization code needs to be @@ -743,7 +743,7 @@ def update_transfer_config( def delete_transfer_config( self, - request: datatransfer.DeleteTransferConfigRequest = None, + request: Union[datatransfer.DeleteTransferConfigRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -754,7 +754,7 @@ def delete_transfer_config( including any associated transfer runs and logs. Args: - request (google.cloud.bigquery_datatransfer_v1.types.DeleteTransferConfigRequest): + request (Union[google.cloud.bigquery_datatransfer_v1.types.DeleteTransferConfigRequest, dict]): The request object. A request to delete data transfer information. All associated transfer runs and log messages will be deleted as well. @@ -811,7 +811,7 @@ def delete_transfer_config( def get_transfer_config( self, - request: datatransfer.GetTransferConfigRequest = None, + request: Union[datatransfer.GetTransferConfigRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -821,7 +821,7 @@ def get_transfer_config( r"""Returns information about a data transfer config. Args: - request (google.cloud.bigquery_datatransfer_v1.types.GetTransferConfigRequest): + request (Union[google.cloud.bigquery_datatransfer_v1.types.GetTransferConfigRequest, dict]): The request object. A request to get data transfer information. name (str): @@ -890,7 +890,7 @@ def get_transfer_config( def list_transfer_configs( self, - request: datatransfer.ListTransferConfigsRequest = None, + request: Union[datatransfer.ListTransferConfigsRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -901,7 +901,7 @@ def list_transfer_configs( by a project in the specified location. Args: - request (google.cloud.bigquery_datatransfer_v1.types.ListTransferConfigsRequest): + request (Union[google.cloud.bigquery_datatransfer_v1.types.ListTransferConfigsRequest, dict]): The request object. A request to list data transfers configured for a BigQuery project. parent (str): @@ -972,7 +972,7 @@ def list_transfer_configs( def schedule_transfer_runs( self, - request: datatransfer.ScheduleTransferRunsRequest = None, + request: Union[datatransfer.ScheduleTransferRunsRequest, dict] = None, *, parent: str = None, start_time: timestamp_pb2.Timestamp = None, @@ -988,7 +988,7 @@ def schedule_transfer_runs( StartManualTransferRuns instead. Args: - request (google.cloud.bigquery_datatransfer_v1.types.ScheduleTransferRunsRequest): + request (Union[google.cloud.bigquery_datatransfer_v1.types.ScheduleTransferRunsRequest, dict]): The request object. A request to schedule transfer runs for a time range. parent (str): @@ -1073,7 +1073,7 @@ def schedule_transfer_runs( def start_manual_transfer_runs( self, - request: datatransfer.StartManualTransferRunsRequest = None, + request: Union[datatransfer.StartManualTransferRunsRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -1085,7 +1085,7 @@ def start_manual_transfer_runs( and end_time (exclusive), or for a specific run_time. Args: - request (google.cloud.bigquery_datatransfer_v1.types.StartManualTransferRunsRequest): + request (Union[google.cloud.bigquery_datatransfer_v1.types.StartManualTransferRunsRequest, dict]): The request object. A request to start manual transfer runs. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1128,7 +1128,7 @@ def start_manual_transfer_runs( def get_transfer_run( self, - request: datatransfer.GetTransferRunRequest = None, + request: Union[datatransfer.GetTransferRunRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1139,7 +1139,7 @@ def get_transfer_run( run. Args: - request (google.cloud.bigquery_datatransfer_v1.types.GetTransferRunRequest): + request (Union[google.cloud.bigquery_datatransfer_v1.types.GetTransferRunRequest, dict]): The request object. A request to get data transfer run information. name (str): @@ -1201,7 +1201,7 @@ def get_transfer_run( def delete_transfer_run( self, - request: datatransfer.DeleteTransferRunRequest = None, + request: Union[datatransfer.DeleteTransferRunRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1211,7 +1211,7 @@ def delete_transfer_run( r"""Deletes the specified transfer run. Args: - request (google.cloud.bigquery_datatransfer_v1.types.DeleteTransferRunRequest): + request (Union[google.cloud.bigquery_datatransfer_v1.types.DeleteTransferRunRequest, dict]): The request object. A request to delete data transfer run information. name (str): @@ -1268,7 +1268,7 @@ def delete_transfer_run( def list_transfer_runs( self, - request: datatransfer.ListTransferRunsRequest = None, + request: Union[datatransfer.ListTransferRunsRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1278,7 +1278,7 @@ def list_transfer_runs( r"""Returns information about running and completed jobs. Args: - request (google.cloud.bigquery_datatransfer_v1.types.ListTransferRunsRequest): + request (Union[google.cloud.bigquery_datatransfer_v1.types.ListTransferRunsRequest, dict]): The request object. A request to list data transfer runs. UI can use this method to show/filter specific data transfer runs. The data source can use this method @@ -1353,7 +1353,7 @@ def list_transfer_runs( def list_transfer_logs( self, - request: datatransfer.ListTransferLogsRequest = None, + request: Union[datatransfer.ListTransferLogsRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1364,7 +1364,7 @@ def list_transfer_logs( transfer run. Args: - request (google.cloud.bigquery_datatransfer_v1.types.ListTransferLogsRequest): + request (Union[google.cloud.bigquery_datatransfer_v1.types.ListTransferLogsRequest, dict]): The request object. A request to get user facing log messages associated with data transfer run. parent (str): @@ -1436,7 +1436,7 @@ def list_transfer_logs( def check_valid_creds( self, - request: datatransfer.CheckValidCredsRequest = None, + request: Union[datatransfer.CheckValidCredsRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1452,7 +1452,7 @@ def check_valid_creds( can create a transfer config. Args: - request (google.cloud.bigquery_datatransfer_v1.types.CheckValidCredsRequest): + request (Union[google.cloud.bigquery_datatransfer_v1.types.CheckValidCredsRequest, dict]): The request object. A request to determine whether the user has valid credentials. This method is used to limit the number of OAuth popups in the user interface. The diff --git a/packages/google-cloud-bigquery-datatransfer/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/base.py b/packages/google-cloud-bigquery-datatransfer/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/base.py index d4a0ff105153..b74eab8e1785 100644 --- a/packages/google-cloud-bigquery-datatransfer/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/base.py +++ b/packages/google-cloud-bigquery-datatransfer/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/base.py @@ -119,7 +119,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-bigquery-datatransfer/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/grpc.py b/packages/google-cloud-bigquery-datatransfer/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/grpc.py index b0041dff8ddb..fb8ae0b5be88 100644 --- a/packages/google-cloud-bigquery-datatransfer/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/grpc.py +++ b/packages/google-cloud-bigquery-datatransfer/google/cloud/bigquery_datatransfer_v1/services/data_transfer_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-bigquery-datatransfer/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/grpc_asyncio.py b/packages/google-cloud-bigquery-datatransfer/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/grpc_asyncio.py index b7c0d6125df5..65a51fba5cec 100644 --- a/packages/google-cloud-bigquery-datatransfer/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/grpc_asyncio.py +++ b/packages/google-cloud-bigquery-datatransfer/google/cloud/bigquery_datatransfer_v1/services/data_transfer_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-bigquery-datatransfer/scripts/fixup_bigquery_datatransfer_v1_keywords.py b/packages/google-cloud-bigquery-datatransfer/scripts/fixup_bigquery_datatransfer_v1_keywords.py index f7746ab5e167..0db416f046fb 100644 --- a/packages/google-cloud-bigquery-datatransfer/scripts/fixup_bigquery_datatransfer_v1_keywords.py +++ b/packages/google-cloud-bigquery-datatransfer/scripts/fixup_bigquery_datatransfer_v1_keywords.py @@ -39,20 +39,20 @@ def partition( class bigquery_datatransferCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'check_valid_creds': ('name', ), - 'create_transfer_config': ('parent', 'transfer_config', 'authorization_code', 'version_info', 'service_account_name', ), - 'delete_transfer_config': ('name', ), - 'delete_transfer_run': ('name', ), - 'get_data_source': ('name', ), - 'get_transfer_config': ('name', ), - 'get_transfer_run': ('name', ), - 'list_data_sources': ('parent', 'page_token', 'page_size', ), - 'list_transfer_configs': ('parent', 'data_source_ids', 'page_token', 'page_size', ), - 'list_transfer_logs': ('parent', 'page_token', 'page_size', 'message_types', ), - 'list_transfer_runs': ('parent', 'states', 'page_token', 'page_size', 'run_attempt', ), - 'schedule_transfer_runs': ('parent', 'start_time', 'end_time', ), - 'start_manual_transfer_runs': ('parent', 'requested_time_range', 'requested_run_time', ), - 'update_transfer_config': ('transfer_config', 'update_mask', 'authorization_code', 'version_info', 'service_account_name', ), + 'check_valid_creds': ('name', ), + 'create_transfer_config': ('parent', 'transfer_config', 'authorization_code', 'version_info', 'service_account_name', ), + 'delete_transfer_config': ('name', ), + 'delete_transfer_run': ('name', ), + 'get_data_source': ('name', ), + 'get_transfer_config': ('name', ), + 'get_transfer_run': ('name', ), + 'list_data_sources': ('parent', 'page_token', 'page_size', ), + 'list_transfer_configs': ('parent', 'data_source_ids', 'page_token', 'page_size', ), + 'list_transfer_logs': ('parent', 'page_token', 'page_size', 'message_types', ), + 'list_transfer_runs': ('parent', 'states', 'page_token', 'page_size', 'run_attempt', ), + 'schedule_transfer_runs': ('parent', 'start_time', 'end_time', ), + 'start_manual_transfer_runs': ('parent', 'requested_time_range', 'requested_run_time', ), + 'update_transfer_config': ('transfer_config', 'update_mask', 'authorization_code', 'version_info', 'service_account_name', ), } def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: @@ -71,7 +71,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 )