From 946e59b34aef35cf64d291d6428f89b114c5e7fd Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 1 Apr 2022 01:18:34 +0000 Subject: [PATCH 1/2] chore(v2): release 2.0.1 --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3462ddb2..afb41e38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://pypi.org/project/google-cloud-datacatalog/#history +### [2.0.1](https://github.com/googleapis/python-datacatalog/compare/v2.0.0...v2.0.1) (2022-04-01) + + +### Bug Fixes + +* **deps:** require google-api-core >= 1.31.5, >= 2.3.2 on v2 release ([#316](https://github.com/googleapis/python-datacatalog/issues/316)) ([3fb76a4](https://github.com/googleapis/python-datacatalog/commit/3fb76a473ee5496bd1fe4a56afef6dc651e66e2f)) + ## [2.0.0](https://www.github.com/googleapis/python-datacatalog/compare/v1.0.0...v2.0.0) (2020-08-20) diff --git a/setup.py b/setup.py index e6f43c1d..f5408409 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ name = "google-cloud-datacatalog" description = "Google Cloud Data Catalog API API client library" -version = "2.0.0" +version = "2.0.1" # Should be one of: # 'Development Status :: 3 - Alpha' # 'Development Status :: 4 - Beta' From 3c3d2cb9e80d511bbc82a464b394376434a3acd3 Mon Sep 17 00:00:00 2001 From: Bu Sun Kim Date: Fri, 1 Apr 2022 21:53:06 +0000 Subject: [PATCH 2/2] chore: use newer black --- docs/conf.py | 17 +- .../services/data_catalog/async_client.py | 235 ++- .../services/data_catalog/client.py | 256 ++- .../services/data_catalog/transports/base.py | 76 +- .../services/data_catalog/transports/grpc.py | 3 +- .../data_catalog/transports/grpc_asyncio.py | 3 +- google/cloud/datacatalog_v1/types/common.py | 5 +- .../cloud/datacatalog_v1/types/datacatalog.py | 152 +- .../datacatalog_v1/types/gcs_fileset_spec.py | 14 +- google/cloud/datacatalog_v1/types/schema.py | 18 +- google/cloud/datacatalog_v1/types/search.py | 16 +- .../cloud/datacatalog_v1/types/table_spec.py | 16 +- google/cloud/datacatalog_v1/types/tags.py | 52 +- .../cloud/datacatalog_v1/types/timestamps.py | 23 +- .../services/data_catalog/async_client.py | 233 ++- .../services/data_catalog/client.py | 256 ++- .../services/data_catalog/transports/base.py | 74 +- .../services/data_catalog/transports/grpc.py | 3 +- .../data_catalog/transports/grpc_asyncio.py | 3 +- .../policy_tag_manager/async_client.py | 101 +- .../services/policy_tag_manager/client.py | 117 +- .../policy_tag_manager/transports/base.py | 48 +- .../policy_tag_manager/transports/grpc.py | 3 +- .../transports/grpc_asyncio.py | 3 +- .../async_client.py | 18 +- .../client.py | 17 +- .../transports/base.py | 8 +- .../transports/grpc.py | 3 +- .../transports/grpc_asyncio.py | 3 +- .../cloud/datacatalog_v1beta1/types/common.py | 5 +- .../datacatalog_v1beta1/types/datacatalog.py | 152 +- .../types/gcs_fileset_spec.py | 13 +- .../types/policytagmanager.py | 54 +- .../types/policytagmanagerserialization.py | 25 +- .../cloud/datacatalog_v1beta1/types/schema.py | 18 +- .../cloud/datacatalog_v1beta1/types/search.py | 11 +- .../datacatalog_v1beta1/types/table_spec.py | 16 +- .../cloud/datacatalog_v1beta1/types/tags.py | 52 +- .../datacatalog_v1beta1/types/timestamps.py | 23 +- noxfile.py | 18 +- .../gapic/datacatalog_v1/test_data_catalog.py | 1663 ++++++++++++---- .../datacatalog_v1beta1/test_data_catalog.py | 1664 +++++++++++++---- .../test_policy_tag_manager.py | 627 +++++-- .../test_policy_tag_manager_serialization.py | 48 +- 44 files changed, 4769 insertions(+), 1396 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 015d055f..1ed5c58b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -66,9 +66,9 @@ master_doc = "index" # General information about the project. -project = u"google-cloud-datacatalog" -copyright = u"2019, Google" -author = u"Google APIs" +project = "google-cloud-datacatalog" +copyright = "2019, Google" +author = "Google APIs" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -267,7 +267,7 @@ ( master_doc, "google-cloud-datacatalog.tex", - u"google-cloud-datacatalog Documentation", + "google-cloud-datacatalog Documentation", author, "manual", ) @@ -302,7 +302,7 @@ ( master_doc, "google-cloud-datacatalog", - u"google-cloud-datacatalog Documentation", + "google-cloud-datacatalog Documentation", [author], 1, ) @@ -321,7 +321,7 @@ ( master_doc, "google-cloud-datacatalog", - u"google-cloud-datacatalog Documentation", + "google-cloud-datacatalog Documentation", author, "google-cloud-datacatalog", "google-cloud-datacatalog Library", @@ -346,7 +346,10 @@ intersphinx_mapping = { "python": ("http://python.readthedocs.org/en/latest/", None), "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,), + "google.api_core": ( + "https://googleapis.dev/python/google-api-core/latest/", + None, + ), "grpc": ("https://grpc.io/grpc/python/", None), } diff --git a/google/cloud/datacatalog_v1/services/data_catalog/async_client.py b/google/cloud/datacatalog_v1/services/data_catalog/async_client.py index 84dac12f..a780ac02 100644 --- a/google/cloud/datacatalog_v1/services/data_catalog/async_client.py +++ b/google/cloud/datacatalog_v1/services/data_catalog/async_client.py @@ -111,7 +111,9 @@ def __init__( """ self._client = DataCatalogClient( - credentials=credentials, transport=transport, client_options=client_options, + credentials=credentials, + transport=transport, + client_options=client_options, ) async def search_catalog( @@ -216,19 +218,29 @@ async def search_catalog( initial=0.1, maximum=60.0, multiplier=1.3, - predicate=retries.if_exception_type(exceptions.ServiceUnavailable,), + predicate=retries.if_exception_type( + exceptions.ServiceUnavailable, + ), ), default_timeout=60.0, client_info=_client_info, ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.SearchCatalogAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -348,7 +360,12 @@ async def create_entry_group( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -422,7 +439,9 @@ async def get_entry_group( initial=0.1, maximum=60.0, multiplier=1.3, - predicate=retries.if_exception_type(exceptions.ServiceUnavailable,), + predicate=retries.if_exception_type( + exceptions.ServiceUnavailable, + ), ), default_timeout=60.0, client_info=_client_info, @@ -435,7 +454,12 @@ async def get_entry_group( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -523,7 +547,12 @@ async def update_entry_group( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -594,7 +623,10 @@ async def delete_entry_group( # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def list_entry_groups( @@ -662,7 +694,9 @@ async def list_entry_groups( initial=0.1, maximum=60.0, multiplier=1.3, - predicate=retries.if_exception_type(exceptions.ServiceUnavailable,), + predicate=retries.if_exception_type( + exceptions.ServiceUnavailable, + ), ), default_timeout=60.0, client_info=_client_info, @@ -675,12 +709,20 @@ async def list_entry_groups( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListEntryGroupsAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -792,7 +834,12 @@ async def create_entry( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -911,7 +958,12 @@ async def update_entry( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -984,7 +1036,10 @@ async def delete_entry( # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def get_entry( @@ -1056,7 +1111,9 @@ async def get_entry( initial=0.1, maximum=60.0, multiplier=1.3, - predicate=retries.if_exception_type(exceptions.ServiceUnavailable,), + predicate=retries.if_exception_type( + exceptions.ServiceUnavailable, + ), ), default_timeout=60.0, client_info=_client_info, @@ -1069,7 +1126,12 @@ async def get_entry( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1125,14 +1187,21 @@ async def lookup_entry( initial=0.1, maximum=60.0, multiplier=1.3, - predicate=retries.if_exception_type(exceptions.ServiceUnavailable,), + predicate=retries.if_exception_type( + exceptions.ServiceUnavailable, + ), ), default_timeout=60.0, client_info=_client_info, ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1201,7 +1270,9 @@ async def list_entries( initial=0.1, maximum=60.0, multiplier=1.3, - predicate=retries.if_exception_type(exceptions.ServiceUnavailable,), + predicate=retries.if_exception_type( + exceptions.ServiceUnavailable, + ), ), default_timeout=60.0, client_info=_client_info, @@ -1214,12 +1285,20 @@ async def list_entries( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListEntriesAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1324,7 +1403,12 @@ async def create_tag_template( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1403,7 +1487,12 @@ async def get_tag_template( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1507,7 +1596,12 @@ async def update_tag_template( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1590,7 +1684,10 @@ async def delete_tag_template( # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def create_tag_template_field( @@ -1692,7 +1789,12 @@ async def create_tag_template_field( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1799,7 +1901,12 @@ async def update_tag_template_field( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1884,7 +1991,12 @@ async def rename_tag_template_field( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1968,7 +2080,10 @@ async def delete_tag_template_field( # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def create_tag( @@ -2061,7 +2176,12 @@ async def create_tag( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2148,7 +2268,12 @@ async def update_tag( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2215,7 +2340,10 @@ async def delete_tag( # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def list_tags( @@ -2287,7 +2415,9 @@ async def list_tags( initial=0.1, maximum=60.0, multiplier=1.3, - predicate=retries.if_exception_type(exceptions.ServiceUnavailable,), + predicate=retries.if_exception_type( + exceptions.ServiceUnavailable, + ), ), default_timeout=60.0, client_info=_client_info, @@ -2300,12 +2430,20 @@ async def list_tags( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListTagsAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -2464,7 +2602,12 @@ async def set_iam_policy( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2619,7 +2762,9 @@ async def get_iam_policy( initial=0.1, maximum=60.0, multiplier=1.3, - predicate=retries.if_exception_type(exceptions.ServiceUnavailable,), + predicate=retries.if_exception_type( + exceptions.ServiceUnavailable, + ), ), default_timeout=60.0, client_info=_client_info, @@ -2632,7 +2777,12 @@ async def get_iam_policy( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2697,7 +2847,12 @@ async def test_iam_permissions( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response diff --git a/google/cloud/datacatalog_v1/services/data_catalog/client.py b/google/cloud/datacatalog_v1/services/data_catalog/client.py index b0e61bf2..9dd3d038 100644 --- a/google/cloud/datacatalog_v1/services/data_catalog/client.py +++ b/google/cloud/datacatalog_v1/services/data_catalog/client.py @@ -60,7 +60,10 @@ class DataCatalogClientMeta(type): _transport_registry["grpc"] = DataCatalogGrpcTransport _transport_registry["grpc_asyncio"] = DataCatalogGrpcAsyncIOTransport - def get_transport_class(cls, label: str = None,) -> Type[DataCatalogTransport]: + def get_transport_class( + cls, + label: str = None, + ) -> Type[DataCatalogTransport]: """Return an appropriate transport class. Args: @@ -139,10 +142,18 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): from_service_account_json = from_service_account_file @staticmethod - def entry_path(project: str, location: str, entry_group: str, entry: str,) -> str: + def entry_path( + project: str, + location: str, + entry_group: str, + entry: str, + ) -> str: """Return a fully-qualified entry string.""" return "projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}".format( - project=project, location=location, entry_group=entry_group, entry=entry, + project=project, + location=location, + entry_group=entry_group, + entry=entry, ) @staticmethod @@ -155,10 +166,18 @@ def parse_entry_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def entry_group_path(project: str, location: str, entry_group: str,) -> str: + def entry_group_path( + project: str, + location: str, + entry_group: str, + ) -> str: """Return a fully-qualified entry_group string.""" - return "projects/{project}/locations/{location}/entryGroups/{entry_group}".format( - project=project, location=location, entry_group=entry_group, + return ( + "projects/{project}/locations/{location}/entryGroups/{entry_group}".format( + project=project, + location=location, + entry_group=entry_group, + ) ) @staticmethod @@ -172,7 +191,11 @@ def parse_entry_group_path(path: str) -> Dict[str, str]: @staticmethod def tag_path( - project: str, location: str, entry_group: str, entry: str, tag: str, + project: str, + location: str, + entry_group: str, + entry: str, + tag: str, ) -> str: """Return a fully-qualified tag string.""" return "projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}/tags/{tag}".format( @@ -193,10 +216,16 @@ def parse_tag_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def tag_template_path(project: str, location: str, tag_template: str,) -> str: + def tag_template_path( + project: str, + location: str, + tag_template: str, + ) -> str: """Return a fully-qualified tag_template string.""" return "projects/{project}/locations/{location}/tagTemplates/{tag_template}".format( - project=project, location=location, tag_template=tag_template, + project=project, + location=location, + tag_template=tag_template, ) @staticmethod @@ -210,11 +239,17 @@ def parse_tag_template_path(path: str) -> Dict[str, str]: @staticmethod def tag_template_field_path( - project: str, location: str, tag_template: str, field: str, + project: str, + location: str, + tag_template: str, + field: str, ) -> str: """Return a fully-qualified tag_template_field string.""" return "projects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{field}".format( - project=project, location=location, tag_template=tag_template, field=field, + project=project, + location=location, + tag_template=tag_template, + field=field, ) @staticmethod @@ -421,12 +456,20 @@ def search_catalog( rpc = self._transport._wrapped_methods[self._transport.search_catalog] # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.SearchCatalogPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -548,7 +591,12 @@ def create_entry_group( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -631,7 +679,12 @@ def get_entry_group( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -721,7 +774,12 @@ def update_entry_group( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -794,7 +852,10 @@ def delete_entry_group( # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def list_entry_groups( @@ -871,12 +932,20 @@ def list_entry_groups( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListEntryGroupsPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -990,7 +1059,12 @@ def create_entry( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1111,7 +1185,12 @@ def update_entry( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1186,7 +1265,10 @@ def delete_entry( # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def get_entry( @@ -1267,7 +1349,12 @@ def get_entry( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1325,7 +1412,12 @@ def lookup_entry( rpc = self._transport._wrapped_methods[self._transport.lookup_entry] # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1403,12 +1495,20 @@ def list_entries( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListEntriesPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1515,7 +1615,12 @@ def create_tag_template( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1596,7 +1701,12 @@ def get_tag_template( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1702,7 +1812,12 @@ def update_tag_template( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1787,7 +1902,10 @@ def delete_tag_template( # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def create_tag_template_field( @@ -1891,7 +2009,12 @@ def create_tag_template_field( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2002,7 +2125,12 @@ def update_tag_template_field( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2091,7 +2219,12 @@ def rename_tag_template_field( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2179,7 +2312,10 @@ def delete_tag_template_field( # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def create_tag( @@ -2274,7 +2410,12 @@ def create_tag( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2363,7 +2504,12 @@ def update_tag( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2432,7 +2578,10 @@ def delete_tag( # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def list_tags( @@ -2513,12 +2662,20 @@ def list_tags( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListTagsPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -2674,7 +2831,12 @@ def set_iam_policy( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2833,7 +2995,12 @@ def get_iam_policy( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2894,7 +3061,12 @@ def test_iam_permissions( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response diff --git a/google/cloud/datacatalog_v1/services/data_catalog/transports/base.py b/google/cloud/datacatalog_v1/services/data_catalog/transports/base.py index 326b640d..791b1785 100644 --- a/google/cloud/datacatalog_v1/services/data_catalog/transports/base.py +++ b/google/cloud/datacatalog_v1/services/data_catalog/transports/base.py @@ -110,13 +110,17 @@ def _prep_wrapped_messages(self): initial=0.1, maximum=60.0, multiplier=1.3, - predicate=retries.if_exception_type(exceptions.ServiceUnavailable,), + predicate=retries.if_exception_type( + exceptions.ServiceUnavailable, + ), ), default_timeout=60.0, client_info=_client_info, ), self.create_entry_group: gapic_v1.method.wrap_method( - self.create_entry_group, default_timeout=None, client_info=_client_info, + self.create_entry_group, + default_timeout=None, + client_info=_client_info, ), self.get_entry_group: gapic_v1.method.wrap_method( self.get_entry_group, @@ -124,16 +128,22 @@ def _prep_wrapped_messages(self): initial=0.1, maximum=60.0, multiplier=1.3, - predicate=retries.if_exception_type(exceptions.ServiceUnavailable,), + predicate=retries.if_exception_type( + exceptions.ServiceUnavailable, + ), ), default_timeout=60.0, client_info=_client_info, ), self.update_entry_group: gapic_v1.method.wrap_method( - self.update_entry_group, default_timeout=None, client_info=_client_info, + self.update_entry_group, + default_timeout=None, + client_info=_client_info, ), self.delete_entry_group: gapic_v1.method.wrap_method( - self.delete_entry_group, default_timeout=None, client_info=_client_info, + self.delete_entry_group, + default_timeout=None, + client_info=_client_info, ), self.list_entry_groups: gapic_v1.method.wrap_method( self.list_entry_groups, @@ -141,19 +151,27 @@ def _prep_wrapped_messages(self): initial=0.1, maximum=60.0, multiplier=1.3, - predicate=retries.if_exception_type(exceptions.ServiceUnavailable,), + predicate=retries.if_exception_type( + exceptions.ServiceUnavailable, + ), ), default_timeout=60.0, client_info=_client_info, ), self.create_entry: gapic_v1.method.wrap_method( - self.create_entry, default_timeout=None, client_info=_client_info, + self.create_entry, + default_timeout=None, + client_info=_client_info, ), self.update_entry: gapic_v1.method.wrap_method( - self.update_entry, default_timeout=None, client_info=_client_info, + self.update_entry, + default_timeout=None, + client_info=_client_info, ), self.delete_entry: gapic_v1.method.wrap_method( - self.delete_entry, default_timeout=None, client_info=_client_info, + self.delete_entry, + default_timeout=None, + client_info=_client_info, ), self.get_entry: gapic_v1.method.wrap_method( self.get_entry, @@ -161,7 +179,9 @@ def _prep_wrapped_messages(self): initial=0.1, maximum=60.0, multiplier=1.3, - predicate=retries.if_exception_type(exceptions.ServiceUnavailable,), + predicate=retries.if_exception_type( + exceptions.ServiceUnavailable, + ), ), default_timeout=60.0, client_info=_client_info, @@ -172,7 +192,9 @@ def _prep_wrapped_messages(self): initial=0.1, maximum=60.0, multiplier=1.3, - predicate=retries.if_exception_type(exceptions.ServiceUnavailable,), + predicate=retries.if_exception_type( + exceptions.ServiceUnavailable, + ), ), default_timeout=60.0, client_info=_client_info, @@ -183,7 +205,9 @@ def _prep_wrapped_messages(self): initial=0.1, maximum=60.0, multiplier=1.3, - predicate=retries.if_exception_type(exceptions.ServiceUnavailable,), + predicate=retries.if_exception_type( + exceptions.ServiceUnavailable, + ), ), default_timeout=60.0, client_info=_client_info, @@ -194,7 +218,9 @@ def _prep_wrapped_messages(self): client_info=_client_info, ), self.get_tag_template: gapic_v1.method.wrap_method( - self.get_tag_template, default_timeout=None, client_info=_client_info, + self.get_tag_template, + default_timeout=None, + client_info=_client_info, ), self.update_tag_template: gapic_v1.method.wrap_method( self.update_tag_template, @@ -227,13 +253,19 @@ def _prep_wrapped_messages(self): client_info=_client_info, ), self.create_tag: gapic_v1.method.wrap_method( - self.create_tag, default_timeout=None, client_info=_client_info, + self.create_tag, + default_timeout=None, + client_info=_client_info, ), self.update_tag: gapic_v1.method.wrap_method( - self.update_tag, default_timeout=None, client_info=_client_info, + self.update_tag, + default_timeout=None, + client_info=_client_info, ), self.delete_tag: gapic_v1.method.wrap_method( - self.delete_tag, default_timeout=None, client_info=_client_info, + self.delete_tag, + default_timeout=None, + client_info=_client_info, ), self.list_tags: gapic_v1.method.wrap_method( self.list_tags, @@ -241,13 +273,17 @@ def _prep_wrapped_messages(self): initial=0.1, maximum=60.0, multiplier=1.3, - predicate=retries.if_exception_type(exceptions.ServiceUnavailable,), + predicate=retries.if_exception_type( + exceptions.ServiceUnavailable, + ), ), default_timeout=60.0, client_info=_client_info, ), self.set_iam_policy: gapic_v1.method.wrap_method( - self.set_iam_policy, default_timeout=None, client_info=_client_info, + self.set_iam_policy, + default_timeout=None, + client_info=_client_info, ), self.get_iam_policy: gapic_v1.method.wrap_method( self.get_iam_policy, @@ -255,7 +291,9 @@ def _prep_wrapped_messages(self): initial=0.1, maximum=60.0, multiplier=1.3, - predicate=retries.if_exception_type(exceptions.ServiceUnavailable,), + predicate=retries.if_exception_type( + exceptions.ServiceUnavailable, + ), ), default_timeout=60.0, client_info=_client_info, diff --git a/google/cloud/datacatalog_v1/services/data_catalog/transports/grpc.py b/google/cloud/datacatalog_v1/services/data_catalog/transports/grpc.py index 9de2ca50..c59ba4d2 100644 --- a/google/cloud/datacatalog_v1/services/data_catalog/transports/grpc.py +++ b/google/cloud/datacatalog_v1/services/data_catalog/transports/grpc.py @@ -202,7 +202,8 @@ def grpc_channel(self) -> grpc.Channel: # have one. if not hasattr(self, "_grpc_channel"): self._grpc_channel = self.create_channel( - self._host, credentials=self._credentials, + self._host, + credentials=self._credentials, ) # Return the channel from cache. diff --git a/google/cloud/datacatalog_v1/services/data_catalog/transports/grpc_asyncio.py b/google/cloud/datacatalog_v1/services/data_catalog/transports/grpc_asyncio.py index 24fdb5c9..935e9a49 100644 --- a/google/cloud/datacatalog_v1/services/data_catalog/transports/grpc_asyncio.py +++ b/google/cloud/datacatalog_v1/services/data_catalog/transports/grpc_asyncio.py @@ -195,7 +195,8 @@ def grpc_channel(self) -> aio.Channel: # have one. if not hasattr(self, "_grpc_channel"): self._grpc_channel = self.create_channel( - self._host, credentials=self._credentials, + self._host, + credentials=self._credentials, ) # Return the channel from cache. diff --git a/google/cloud/datacatalog_v1/types/common.py b/google/cloud/datacatalog_v1/types/common.py index feace354..5db4267d 100644 --- a/google/cloud/datacatalog_v1/types/common.py +++ b/google/cloud/datacatalog_v1/types/common.py @@ -19,7 +19,10 @@ __protobuf__ = proto.module( - package="google.cloud.datacatalog.v1", manifest={"IntegratedSystem",}, + package="google.cloud.datacatalog.v1", + manifest={ + "IntegratedSystem", + }, ) diff --git a/google/cloud/datacatalog_v1/types/datacatalog.py b/google/cloud/datacatalog_v1/types/datacatalog.py index fdb31546..2db32276 100644 --- a/google/cloud/datacatalog_v1/types/datacatalog.py +++ b/google/cloud/datacatalog_v1/types/datacatalog.py @@ -195,7 +195,11 @@ class Scope(proto.Message): restricted_locations = proto.RepeatedField(proto.STRING, number=16) - scope = proto.Field(proto.MESSAGE, number=6, message=Scope,) + scope = proto.Field( + proto.MESSAGE, + number=6, + message=Scope, + ) query = proto.Field(proto.STRING, number=1) @@ -229,7 +233,9 @@ def raw_page(self): return self results = proto.RepeatedField( - proto.MESSAGE, number=1, message=search.SearchCatalogResult, + proto.MESSAGE, + number=1, + message=search.SearchCatalogResult, ) next_page_token = proto.Field(proto.STRING, number=3) @@ -265,7 +271,11 @@ class CreateEntryGroupRequest(proto.Message): entry_group_id = proto.Field(proto.STRING, number=3) - entry_group = proto.Field(proto.MESSAGE, number=2, message="EntryGroup",) + entry_group = proto.Field( + proto.MESSAGE, + number=2, + message="EntryGroup", + ) class UpdateEntryGroupRequest(proto.Message): @@ -282,9 +292,17 @@ class UpdateEntryGroupRequest(proto.Message): updated. """ - entry_group = proto.Field(proto.MESSAGE, number=1, message="EntryGroup",) + entry_group = proto.Field( + proto.MESSAGE, + number=1, + message="EntryGroup", + ) - update_mask = proto.Field(proto.MESSAGE, number=2, message=field_mask.FieldMask,) + update_mask = proto.Field( + proto.MESSAGE, + number=2, + message=field_mask.FieldMask, + ) class GetEntryGroupRequest(proto.Message): @@ -302,7 +320,11 @@ class GetEntryGroupRequest(proto.Message): name = proto.Field(proto.STRING, number=1) - read_mask = proto.Field(proto.MESSAGE, number=2, message=field_mask.FieldMask,) + read_mask = proto.Field( + proto.MESSAGE, + number=2, + message=field_mask.FieldMask, + ) class DeleteEntryGroupRequest(proto.Message): @@ -366,7 +388,11 @@ class ListEntryGroupsResponse(proto.Message): def raw_page(self): return self - entry_groups = proto.RepeatedField(proto.MESSAGE, number=1, message="EntryGroup",) + entry_groups = proto.RepeatedField( + proto.MESSAGE, + number=1, + message="EntryGroup", + ) next_page_token = proto.Field(proto.STRING, number=2) @@ -394,7 +420,11 @@ class CreateEntryRequest(proto.Message): entry_id = proto.Field(proto.STRING, number=3) - entry = proto.Field(proto.MESSAGE, number=2, message="Entry",) + entry = proto.Field( + proto.MESSAGE, + number=2, + message="Entry", + ) class UpdateEntryRequest(proto.Message): @@ -434,9 +464,17 @@ class UpdateEntryRequest(proto.Message): - source_system_timestamps """ - entry = proto.Field(proto.MESSAGE, number=1, message="Entry",) + entry = proto.Field( + proto.MESSAGE, + number=1, + message="Entry", + ) - update_mask = proto.Field(proto.MESSAGE, number=2, message=field_mask.FieldMask,) + update_mask = proto.Field( + proto.MESSAGE, + number=2, + message=field_mask.FieldMask, + ) class DeleteEntryRequest(proto.Message): @@ -601,12 +639,20 @@ class Entry(proto.Message): linked_resource = proto.Field(proto.STRING, number=9) - type = proto.Field(proto.ENUM, number=2, oneof="entry_type", enum="EntryType",) + type = proto.Field( + proto.ENUM, + number=2, + oneof="entry_type", + enum="EntryType", + ) user_specified_type = proto.Field(proto.STRING, number=16, oneof="entry_type") integrated_system = proto.Field( - proto.ENUM, number=17, oneof="system", enum=common.IntegratedSystem, + proto.ENUM, + number=17, + oneof="system", + enum=common.IntegratedSystem, ) user_specified_system = proto.Field(proto.STRING, number=18, oneof="system") @@ -636,10 +682,16 @@ class Entry(proto.Message): description = proto.Field(proto.STRING, number=4) - schema = proto.Field(proto.MESSAGE, number=5, message=gcd_schema.Schema,) + schema = proto.Field( + proto.MESSAGE, + number=5, + message=gcd_schema.Schema, + ) source_system_timestamps = proto.Field( - proto.MESSAGE, number=7, message=timestamps.SystemTimestamps, + proto.MESSAGE, + number=7, + message=timestamps.SystemTimestamps, ) @@ -677,7 +729,9 @@ class EntryGroup(proto.Message): description = proto.Field(proto.STRING, number=3) data_catalog_timestamps = proto.Field( - proto.MESSAGE, number=4, message=timestamps.SystemTimestamps, + proto.MESSAGE, + number=4, + message=timestamps.SystemTimestamps, ) @@ -704,7 +758,11 @@ class CreateTagTemplateRequest(proto.Message): tag_template_id = proto.Field(proto.STRING, number=3) - tag_template = proto.Field(proto.MESSAGE, number=2, message=gcd_tags.TagTemplate,) + tag_template = proto.Field( + proto.MESSAGE, + number=2, + message=gcd_tags.TagTemplate, + ) class GetTagTemplateRequest(proto.Message): @@ -741,9 +799,17 @@ class UpdateTagTemplateRequest(proto.Message): updated. """ - tag_template = proto.Field(proto.MESSAGE, number=1, message=gcd_tags.TagTemplate,) + tag_template = proto.Field( + proto.MESSAGE, + number=1, + message=gcd_tags.TagTemplate, + ) - update_mask = proto.Field(proto.MESSAGE, number=2, message=field_mask.FieldMask,) + update_mask = proto.Field( + proto.MESSAGE, + number=2, + message=field_mask.FieldMask, + ) class DeleteTagTemplateRequest(proto.Message): @@ -786,7 +852,11 @@ class CreateTagRequest(proto.Message): parent = proto.Field(proto.STRING, number=1) - tag = proto.Field(proto.MESSAGE, number=2, message=gcd_tags.Tag,) + tag = proto.Field( + proto.MESSAGE, + number=2, + message=gcd_tags.Tag, + ) class UpdateTagRequest(proto.Message): @@ -803,9 +873,17 @@ class UpdateTagRequest(proto.Message): field is the field ``fields``. """ - tag = proto.Field(proto.MESSAGE, number=1, message=gcd_tags.Tag,) + tag = proto.Field( + proto.MESSAGE, + number=1, + message=gcd_tags.Tag, + ) - update_mask = proto.Field(proto.MESSAGE, number=2, message=field_mask.FieldMask,) + update_mask = proto.Field( + proto.MESSAGE, + number=2, + message=field_mask.FieldMask, + ) class DeleteTagRequest(proto.Message): @@ -849,7 +927,9 @@ class CreateTagTemplateFieldRequest(proto.Message): tag_template_field_id = proto.Field(proto.STRING, number=2) tag_template_field = proto.Field( - proto.MESSAGE, number=3, message=gcd_tags.TagTemplateField, + proto.MESSAGE, + number=3, + message=gcd_tags.TagTemplateField, ) @@ -885,10 +965,16 @@ class UpdateTagTemplateFieldRequest(proto.Message): name = proto.Field(proto.STRING, number=1) tag_template_field = proto.Field( - proto.MESSAGE, number=2, message=gcd_tags.TagTemplateField, + proto.MESSAGE, + number=2, + message=gcd_tags.TagTemplateField, ) - update_mask = proto.Field(proto.MESSAGE, number=3, message=field_mask.FieldMask,) + update_mask = proto.Field( + proto.MESSAGE, + number=3, + message=field_mask.FieldMask, + ) class RenameTagTemplateFieldRequest(proto.Message): @@ -979,7 +1065,11 @@ class ListTagsResponse(proto.Message): def raw_page(self): return self - tags = proto.RepeatedField(proto.MESSAGE, number=1, message=gcd_tags.Tag,) + tags = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=gcd_tags.Tag, + ) next_page_token = proto.Field(proto.STRING, number=2) @@ -1014,7 +1104,11 @@ class ListEntriesRequest(proto.Message): page_token = proto.Field(proto.STRING, number=3) - read_mask = proto.Field(proto.MESSAGE, number=4, message=field_mask.FieldMask,) + read_mask = proto.Field( + proto.MESSAGE, + number=4, + message=field_mask.FieldMask, + ) class ListEntriesResponse(proto.Message): @@ -1034,7 +1128,11 @@ class ListEntriesResponse(proto.Message): def raw_page(self): return self - entries = proto.RepeatedField(proto.MESSAGE, number=1, message=Entry,) + entries = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=Entry, + ) next_page_token = proto.Field(proto.STRING, number=2) diff --git a/google/cloud/datacatalog_v1/types/gcs_fileset_spec.py b/google/cloud/datacatalog_v1/types/gcs_fileset_spec.py index 64518aff..ef5e2a3e 100644 --- a/google/cloud/datacatalog_v1/types/gcs_fileset_spec.py +++ b/google/cloud/datacatalog_v1/types/gcs_fileset_spec.py @@ -22,7 +22,11 @@ __protobuf__ = proto.module( - package="google.cloud.datacatalog.v1", manifest={"GcsFilesetSpec", "GcsFileSpec",}, + package="google.cloud.datacatalog.v1", + manifest={ + "GcsFilesetSpec", + "GcsFileSpec", + }, ) @@ -72,7 +76,9 @@ class GcsFilesetSpec(proto.Message): file_patterns = proto.RepeatedField(proto.STRING, number=1) sample_gcs_file_specs = proto.RepeatedField( - proto.MESSAGE, number=2, message="GcsFileSpec", + proto.MESSAGE, + number=2, + message="GcsFileSpec", ) @@ -93,7 +99,9 @@ class GcsFileSpec(proto.Message): file_path = proto.Field(proto.STRING, number=1) gcs_timestamps = proto.Field( - proto.MESSAGE, number=2, message=timestamps.SystemTimestamps, + proto.MESSAGE, + number=2, + message=timestamps.SystemTimestamps, ) size_bytes = proto.Field(proto.INT64, number=4) diff --git a/google/cloud/datacatalog_v1/types/schema.py b/google/cloud/datacatalog_v1/types/schema.py index 4a51a122..4de8a8ea 100644 --- a/google/cloud/datacatalog_v1/types/schema.py +++ b/google/cloud/datacatalog_v1/types/schema.py @@ -19,7 +19,11 @@ __protobuf__ = proto.module( - package="google.cloud.datacatalog.v1", manifest={"Schema", "ColumnSchema",}, + package="google.cloud.datacatalog.v1", + manifest={ + "Schema", + "ColumnSchema", + }, ) @@ -32,7 +36,11 @@ class Schema(proto.Message): 10,000 columns and sub-columns can be specified. """ - columns = proto.RepeatedField(proto.MESSAGE, number=2, message="ColumnSchema",) + columns = proto.RepeatedField( + proto.MESSAGE, + number=2, + message="ColumnSchema", + ) class ColumnSchema(proto.Message): @@ -65,7 +73,11 @@ class ColumnSchema(proto.Message): mode = proto.Field(proto.STRING, number=3) - subcolumns = proto.RepeatedField(proto.MESSAGE, number=7, message="ColumnSchema",) + subcolumns = proto.RepeatedField( + proto.MESSAGE, + number=7, + message="ColumnSchema", + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/datacatalog_v1/types/search.py b/google/cloud/datacatalog_v1/types/search.py index eb4370da..f80f4ab0 100644 --- a/google/cloud/datacatalog_v1/types/search.py +++ b/google/cloud/datacatalog_v1/types/search.py @@ -23,7 +23,10 @@ __protobuf__ = proto.module( package="google.cloud.datacatalog.v1", - manifest={"SearchResultType", "SearchCatalogResult",}, + manifest={ + "SearchResultType", + "SearchCatalogResult", + }, ) @@ -76,7 +79,11 @@ class SearchCatalogResult(proto.Message): with. """ - search_result_type = proto.Field(proto.ENUM, number=1, enum="SearchResultType",) + search_result_type = proto.Field( + proto.ENUM, + number=1, + enum="SearchResultType", + ) search_result_subtype = proto.Field(proto.STRING, number=2) @@ -85,7 +92,10 @@ class SearchCatalogResult(proto.Message): linked_resource = proto.Field(proto.STRING, number=4) integrated_system = proto.Field( - proto.ENUM, number=8, oneof="system", enum=common.IntegratedSystem, + proto.ENUM, + number=8, + oneof="system", + enum=common.IntegratedSystem, ) user_specified_system = proto.Field(proto.STRING, number=9, oneof="system") diff --git a/google/cloud/datacatalog_v1/types/table_spec.py b/google/cloud/datacatalog_v1/types/table_spec.py index 4c86f64f..6e2ea540 100644 --- a/google/cloud/datacatalog_v1/types/table_spec.py +++ b/google/cloud/datacatalog_v1/types/table_spec.py @@ -51,14 +51,24 @@ class BigQueryTableSpec(proto.Message): populated if ``table_source_type`` is ``BIGQUERY_TABLE``. """ - table_source_type = proto.Field(proto.ENUM, number=1, enum="TableSourceType",) + table_source_type = proto.Field( + proto.ENUM, + number=1, + enum="TableSourceType", + ) view_spec = proto.Field( - proto.MESSAGE, number=2, oneof="type_spec", message="ViewSpec", + proto.MESSAGE, + number=2, + oneof="type_spec", + message="ViewSpec", ) table_spec = proto.Field( - proto.MESSAGE, number=3, oneof="type_spec", message="TableSpec", + proto.MESSAGE, + number=3, + oneof="type_spec", + message="TableSpec", ) diff --git a/google/cloud/datacatalog_v1/types/tags.py b/google/cloud/datacatalog_v1/types/tags.py index 8e6e94e0..71750cbe 100644 --- a/google/cloud/datacatalog_v1/types/tags.py +++ b/google/cloud/datacatalog_v1/types/tags.py @@ -23,7 +23,13 @@ __protobuf__ = proto.module( package="google.cloud.datacatalog.v1", - manifest={"Tag", "TagField", "TagTemplate", "TagTemplateField", "FieldType",}, + manifest={ + "Tag", + "TagField", + "TagTemplate", + "TagTemplateField", + "FieldType", + }, ) @@ -79,7 +85,12 @@ class Tag(proto.Message): column = proto.Field(proto.STRING, number=4, oneof="scope") - fields = proto.MapField(proto.STRING, proto.MESSAGE, number=3, message="TagField",) + fields = proto.MapField( + proto.STRING, + proto.MESSAGE, + number=3, + message="TagField", + ) class TagField(proto.Message): @@ -134,10 +145,18 @@ class EnumValue(proto.Message): bool_value = proto.Field(proto.BOOL, number=4, oneof="kind") timestamp_value = proto.Field( - proto.MESSAGE, number=5, oneof="kind", message=timestamp.Timestamp, + proto.MESSAGE, + number=5, + oneof="kind", + message=timestamp.Timestamp, ) - enum_value = proto.Field(proto.MESSAGE, number=6, oneof="kind", message=EnumValue,) + enum_value = proto.Field( + proto.MESSAGE, + number=6, + oneof="kind", + message=EnumValue, + ) order = proto.Field(proto.INT32, number=7) @@ -183,7 +202,10 @@ class TagTemplate(proto.Message): display_name = proto.Field(proto.STRING, number=2) fields = proto.MapField( - proto.STRING, proto.MESSAGE, number=3, message="TagTemplateField", + proto.STRING, + proto.MESSAGE, + number=3, + message="TagTemplateField", ) @@ -221,7 +243,11 @@ class TagTemplateField(proto.Message): display_name = proto.Field(proto.STRING, number=1) - type = proto.Field(proto.MESSAGE, number=2, message="FieldType",) + type = proto.Field( + proto.MESSAGE, + number=2, + message="FieldType", + ) is_required = proto.Field(proto.BOOL, number=3) @@ -276,15 +302,23 @@ class EnumValue(proto.Message): display_name = proto.Field(proto.STRING, number=1) allowed_values = proto.RepeatedField( - proto.MESSAGE, number=1, message="FieldType.EnumType.EnumValue", + proto.MESSAGE, + number=1, + message="FieldType.EnumType.EnumValue", ) primitive_type = proto.Field( - proto.ENUM, number=1, oneof="type_decl", enum=PrimitiveType, + proto.ENUM, + number=1, + oneof="type_decl", + enum=PrimitiveType, ) enum_type = proto.Field( - proto.MESSAGE, number=2, oneof="type_decl", message=EnumType, + proto.MESSAGE, + number=2, + oneof="type_decl", + message=EnumType, ) diff --git a/google/cloud/datacatalog_v1/types/timestamps.py b/google/cloud/datacatalog_v1/types/timestamps.py index 451b9a43..e1b15400 100644 --- a/google/cloud/datacatalog_v1/types/timestamps.py +++ b/google/cloud/datacatalog_v1/types/timestamps.py @@ -22,7 +22,10 @@ __protobuf__ = proto.module( - package="google.cloud.datacatalog.v1", manifest={"SystemTimestamps",}, + package="google.cloud.datacatalog.v1", + manifest={ + "SystemTimestamps", + }, ) @@ -43,11 +46,23 @@ class SystemTimestamps(proto.Message): apllicable to BigQuery resources. """ - create_time = proto.Field(proto.MESSAGE, number=1, message=timestamp.Timestamp,) + create_time = proto.Field( + proto.MESSAGE, + number=1, + message=timestamp.Timestamp, + ) - update_time = proto.Field(proto.MESSAGE, number=2, message=timestamp.Timestamp,) + update_time = proto.Field( + proto.MESSAGE, + number=2, + message=timestamp.Timestamp, + ) - expire_time = proto.Field(proto.MESSAGE, number=3, message=timestamp.Timestamp,) + expire_time = proto.Field( + proto.MESSAGE, + number=3, + message=timestamp.Timestamp, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/datacatalog_v1beta1/services/data_catalog/async_client.py b/google/cloud/datacatalog_v1beta1/services/data_catalog/async_client.py index ee21855f..75210bae 100644 --- a/google/cloud/datacatalog_v1beta1/services/data_catalog/async_client.py +++ b/google/cloud/datacatalog_v1beta1/services/data_catalog/async_client.py @@ -111,7 +111,9 @@ def __init__( """ self._client = DataCatalogClient( - credentials=credentials, transport=transport, client_options=client_options, + credentials=credentials, + transport=transport, + client_options=client_options, ) async def search_catalog( @@ -217,12 +219,20 @@ async def search_catalog( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.SearchCatalogAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -330,7 +340,12 @@ async def create_entry_group( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -419,7 +434,12 @@ async def update_entry_group( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -495,7 +515,8 @@ async def get_entry_group( maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, + exceptions.DeadlineExceeded, + exceptions.ServiceUnavailable, ), ), default_timeout=60.0, @@ -509,7 +530,12 @@ async def get_entry_group( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -573,7 +599,8 @@ async def delete_entry_group( maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, + exceptions.DeadlineExceeded, + exceptions.ServiceUnavailable, ), ), default_timeout=60.0, @@ -588,7 +615,10 @@ async def delete_entry_group( # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def list_entry_groups( @@ -663,12 +693,20 @@ async def list_entry_groups( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListEntryGroupsAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -780,7 +818,12 @@ async def create_entry( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -899,7 +942,12 @@ async def update_entry( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -965,7 +1013,8 @@ async def delete_entry( maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, + exceptions.DeadlineExceeded, + exceptions.ServiceUnavailable, ), ), default_timeout=60.0, @@ -980,7 +1029,10 @@ async def delete_entry( # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def get_entry( @@ -1053,7 +1105,8 @@ async def get_entry( maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, + exceptions.DeadlineExceeded, + exceptions.ServiceUnavailable, ), ), default_timeout=60.0, @@ -1067,7 +1120,12 @@ async def get_entry( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1124,7 +1182,8 @@ async def lookup_entry( maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, + exceptions.DeadlineExceeded, + exceptions.ServiceUnavailable, ), ), default_timeout=60.0, @@ -1132,7 +1191,12 @@ async def lookup_entry( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1208,12 +1272,20 @@ async def list_entries( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListEntriesAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1318,7 +1390,12 @@ async def create_tag_template( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1391,7 +1468,8 @@ async def get_tag_template( maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, + exceptions.DeadlineExceeded, + exceptions.ServiceUnavailable, ), ), default_timeout=60.0, @@ -1405,7 +1483,12 @@ async def get_tag_template( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1509,7 +1592,12 @@ async def update_tag_template( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1585,7 +1673,8 @@ async def delete_tag_template( maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, + exceptions.DeadlineExceeded, + exceptions.ServiceUnavailable, ), ), default_timeout=60.0, @@ -1600,7 +1689,10 @@ async def delete_tag_template( # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def create_tag_template_field( @@ -1702,7 +1794,12 @@ async def create_tag_template_field( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1809,7 +1906,12 @@ async def update_tag_template_field( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1894,7 +1996,12 @@ async def rename_tag_template_field( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1971,7 +2078,8 @@ async def delete_tag_template_field( maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, + exceptions.DeadlineExceeded, + exceptions.ServiceUnavailable, ), ), default_timeout=60.0, @@ -1986,7 +2094,10 @@ async def delete_tag_template_field( # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def create_tag( @@ -2080,7 +2191,12 @@ async def create_tag( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2167,7 +2283,12 @@ async def update_tag( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2227,7 +2348,8 @@ async def delete_tag( maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, + exceptions.DeadlineExceeded, + exceptions.ServiceUnavailable, ), ), default_timeout=60.0, @@ -2242,7 +2364,10 @@ async def delete_tag( # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def list_tags( @@ -2316,7 +2441,8 @@ async def list_tags( maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, + exceptions.DeadlineExceeded, + exceptions.ServiceUnavailable, ), ), default_timeout=60.0, @@ -2330,12 +2456,20 @@ async def list_tags( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListTagsAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -2494,7 +2628,12 @@ async def set_iam_policy( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2656,7 +2795,12 @@ async def get_iam_policy( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2721,7 +2865,12 @@ async def test_iam_permissions( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response diff --git a/google/cloud/datacatalog_v1beta1/services/data_catalog/client.py b/google/cloud/datacatalog_v1beta1/services/data_catalog/client.py index 08b4f5b7..e46a0806 100644 --- a/google/cloud/datacatalog_v1beta1/services/data_catalog/client.py +++ b/google/cloud/datacatalog_v1beta1/services/data_catalog/client.py @@ -60,7 +60,10 @@ class DataCatalogClientMeta(type): _transport_registry["grpc"] = DataCatalogGrpcTransport _transport_registry["grpc_asyncio"] = DataCatalogGrpcAsyncIOTransport - def get_transport_class(cls, label: str = None,) -> Type[DataCatalogTransport]: + def get_transport_class( + cls, + label: str = None, + ) -> Type[DataCatalogTransport]: """Return an appropriate transport class. Args: @@ -139,10 +142,18 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): from_service_account_json = from_service_account_file @staticmethod - def entry_path(project: str, location: str, entry_group: str, entry: str,) -> str: + def entry_path( + project: str, + location: str, + entry_group: str, + entry: str, + ) -> str: """Return a fully-qualified entry string.""" return "projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}".format( - project=project, location=location, entry_group=entry_group, entry=entry, + project=project, + location=location, + entry_group=entry_group, + entry=entry, ) @staticmethod @@ -155,10 +166,18 @@ def parse_entry_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def entry_group_path(project: str, location: str, entry_group: str,) -> str: + def entry_group_path( + project: str, + location: str, + entry_group: str, + ) -> str: """Return a fully-qualified entry_group string.""" - return "projects/{project}/locations/{location}/entryGroups/{entry_group}".format( - project=project, location=location, entry_group=entry_group, + return ( + "projects/{project}/locations/{location}/entryGroups/{entry_group}".format( + project=project, + location=location, + entry_group=entry_group, + ) ) @staticmethod @@ -172,7 +191,11 @@ def parse_entry_group_path(path: str) -> Dict[str, str]: @staticmethod def tag_path( - project: str, location: str, entry_group: str, entry: str, tag: str, + project: str, + location: str, + entry_group: str, + entry: str, + tag: str, ) -> str: """Return a fully-qualified tag string.""" return "projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}/tags/{tag}".format( @@ -193,10 +216,16 @@ def parse_tag_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def tag_template_path(project: str, location: str, tag_template: str,) -> str: + def tag_template_path( + project: str, + location: str, + tag_template: str, + ) -> str: """Return a fully-qualified tag_template string.""" return "projects/{project}/locations/{location}/tagTemplates/{tag_template}".format( - project=project, location=location, tag_template=tag_template, + project=project, + location=location, + tag_template=tag_template, ) @staticmethod @@ -210,11 +239,17 @@ def parse_tag_template_path(path: str) -> Dict[str, str]: @staticmethod def tag_template_field_path( - project: str, location: str, tag_template: str, field: str, + project: str, + location: str, + tag_template: str, + field: str, ) -> str: """Return a fully-qualified tag_template_field string.""" return "projects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{field}".format( - project=project, location=location, tag_template=tag_template, field=field, + project=project, + location=location, + tag_template=tag_template, + field=field, ) @staticmethod @@ -421,12 +456,20 @@ def search_catalog( rpc = self._transport._wrapped_methods[self._transport.search_catalog] # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.SearchCatalogPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -536,7 +579,12 @@ def create_entry_group( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -627,7 +675,12 @@ def update_entry_group( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -711,7 +764,12 @@ def get_entry_group( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -784,7 +842,10 @@ def delete_entry_group( # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def list_entry_groups( @@ -861,12 +922,20 @@ def list_entry_groups( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListEntryGroupsPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -980,7 +1049,12 @@ def create_entry( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1101,7 +1175,12 @@ def update_entry( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1176,7 +1255,10 @@ def delete_entry( # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def get_entry( @@ -1257,7 +1339,12 @@ def get_entry( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1315,7 +1402,12 @@ def lookup_entry( rpc = self._transport._wrapped_methods[self._transport.lookup_entry] # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1393,12 +1485,20 @@ def list_entries( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListEntriesPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1505,7 +1605,12 @@ def create_tag_template( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1586,7 +1691,12 @@ def get_tag_template( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1692,7 +1802,12 @@ def update_tag_template( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1777,7 +1892,10 @@ def delete_tag_template( # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def create_tag_template_field( @@ -1881,7 +1999,12 @@ def create_tag_template_field( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1992,7 +2115,12 @@ def update_tag_template_field( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2081,7 +2209,12 @@ def rename_tag_template_field( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2169,7 +2302,10 @@ def delete_tag_template_field( # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def create_tag( @@ -2265,7 +2401,12 @@ def create_tag( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2354,7 +2495,12 @@ def update_tag( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2423,7 +2569,10 @@ def delete_tag( # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def list_tags( @@ -2505,12 +2654,20 @@ def list_tags( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListTagsPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -2666,7 +2823,12 @@ def set_iam_policy( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2825,7 +2987,12 @@ def get_iam_policy( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2886,7 +3053,12 @@ def test_iam_permissions( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response diff --git a/google/cloud/datacatalog_v1beta1/services/data_catalog/transports/base.py b/google/cloud/datacatalog_v1beta1/services/data_catalog/transports/base.py index fac99233..862d1df1 100644 --- a/google/cloud/datacatalog_v1beta1/services/data_catalog/transports/base.py +++ b/google/cloud/datacatalog_v1beta1/services/data_catalog/transports/base.py @@ -105,13 +105,19 @@ def _prep_wrapped_messages(self): # Precompute the wrapped methods. self._wrapped_methods = { self.search_catalog: gapic_v1.method.wrap_method( - self.search_catalog, default_timeout=None, client_info=_client_info, + self.search_catalog, + default_timeout=None, + client_info=_client_info, ), self.create_entry_group: gapic_v1.method.wrap_method( - self.create_entry_group, default_timeout=None, client_info=_client_info, + self.create_entry_group, + default_timeout=None, + client_info=_client_info, ), self.update_entry_group: gapic_v1.method.wrap_method( - self.update_entry_group, default_timeout=None, client_info=_client_info, + self.update_entry_group, + default_timeout=None, + client_info=_client_info, ), self.get_entry_group: gapic_v1.method.wrap_method( self.get_entry_group, @@ -120,7 +126,8 @@ def _prep_wrapped_messages(self): maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, + exceptions.DeadlineExceeded, + exceptions.ServiceUnavailable, ), ), default_timeout=60.0, @@ -133,20 +140,27 @@ def _prep_wrapped_messages(self): maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, + exceptions.DeadlineExceeded, + exceptions.ServiceUnavailable, ), ), default_timeout=60.0, client_info=_client_info, ), self.list_entry_groups: gapic_v1.method.wrap_method( - self.list_entry_groups, default_timeout=None, client_info=_client_info, + self.list_entry_groups, + default_timeout=None, + client_info=_client_info, ), self.create_entry: gapic_v1.method.wrap_method( - self.create_entry, default_timeout=None, client_info=_client_info, + self.create_entry, + default_timeout=None, + client_info=_client_info, ), self.update_entry: gapic_v1.method.wrap_method( - self.update_entry, default_timeout=None, client_info=_client_info, + self.update_entry, + default_timeout=None, + client_info=_client_info, ), self.delete_entry: gapic_v1.method.wrap_method( self.delete_entry, @@ -155,7 +169,8 @@ def _prep_wrapped_messages(self): maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, + exceptions.DeadlineExceeded, + exceptions.ServiceUnavailable, ), ), default_timeout=60.0, @@ -168,7 +183,8 @@ def _prep_wrapped_messages(self): maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, + exceptions.DeadlineExceeded, + exceptions.ServiceUnavailable, ), ), default_timeout=60.0, @@ -181,14 +197,17 @@ def _prep_wrapped_messages(self): maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, + exceptions.DeadlineExceeded, + exceptions.ServiceUnavailable, ), ), default_timeout=60.0, client_info=_client_info, ), self.list_entries: gapic_v1.method.wrap_method( - self.list_entries, default_timeout=None, client_info=_client_info, + self.list_entries, + default_timeout=None, + client_info=_client_info, ), self.create_tag_template: gapic_v1.method.wrap_method( self.create_tag_template, @@ -202,7 +221,8 @@ def _prep_wrapped_messages(self): maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, + exceptions.DeadlineExceeded, + exceptions.ServiceUnavailable, ), ), default_timeout=60.0, @@ -220,7 +240,8 @@ def _prep_wrapped_messages(self): maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, + exceptions.DeadlineExceeded, + exceptions.ServiceUnavailable, ), ), default_timeout=60.0, @@ -248,17 +269,22 @@ def _prep_wrapped_messages(self): maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, + exceptions.DeadlineExceeded, + exceptions.ServiceUnavailable, ), ), default_timeout=60.0, client_info=_client_info, ), self.create_tag: gapic_v1.method.wrap_method( - self.create_tag, default_timeout=None, client_info=_client_info, + self.create_tag, + default_timeout=None, + client_info=_client_info, ), self.update_tag: gapic_v1.method.wrap_method( - self.update_tag, default_timeout=None, client_info=_client_info, + self.update_tag, + default_timeout=None, + client_info=_client_info, ), self.delete_tag: gapic_v1.method.wrap_method( self.delete_tag, @@ -267,7 +293,8 @@ def _prep_wrapped_messages(self): maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, + exceptions.DeadlineExceeded, + exceptions.ServiceUnavailable, ), ), default_timeout=60.0, @@ -280,17 +307,22 @@ def _prep_wrapped_messages(self): maximum=60.0, multiplier=1.3, predicate=retries.if_exception_type( - exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, + exceptions.DeadlineExceeded, + exceptions.ServiceUnavailable, ), ), default_timeout=60.0, client_info=_client_info, ), self.set_iam_policy: gapic_v1.method.wrap_method( - self.set_iam_policy, default_timeout=None, client_info=_client_info, + self.set_iam_policy, + default_timeout=None, + client_info=_client_info, ), self.get_iam_policy: gapic_v1.method.wrap_method( - self.get_iam_policy, default_timeout=None, client_info=_client_info, + self.get_iam_policy, + default_timeout=None, + client_info=_client_info, ), self.test_iam_permissions: gapic_v1.method.wrap_method( self.test_iam_permissions, diff --git a/google/cloud/datacatalog_v1beta1/services/data_catalog/transports/grpc.py b/google/cloud/datacatalog_v1beta1/services/data_catalog/transports/grpc.py index 1b96a954..54b6c572 100644 --- a/google/cloud/datacatalog_v1beta1/services/data_catalog/transports/grpc.py +++ b/google/cloud/datacatalog_v1beta1/services/data_catalog/transports/grpc.py @@ -202,7 +202,8 @@ def grpc_channel(self) -> grpc.Channel: # have one. if not hasattr(self, "_grpc_channel"): self._grpc_channel = self.create_channel( - self._host, credentials=self._credentials, + self._host, + credentials=self._credentials, ) # Return the channel from cache. diff --git a/google/cloud/datacatalog_v1beta1/services/data_catalog/transports/grpc_asyncio.py b/google/cloud/datacatalog_v1beta1/services/data_catalog/transports/grpc_asyncio.py index 1d7f80fd..9f0818ad 100644 --- a/google/cloud/datacatalog_v1beta1/services/data_catalog/transports/grpc_asyncio.py +++ b/google/cloud/datacatalog_v1beta1/services/data_catalog/transports/grpc_asyncio.py @@ -195,7 +195,8 @@ def grpc_channel(self) -> aio.Channel: # have one. if not hasattr(self, "_grpc_channel"): self._grpc_channel = self.create_channel( - self._host, credentials=self._credentials, + self._host, + credentials=self._credentials, ) # Return the channel from cache. diff --git a/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/async_client.py b/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/async_client.py index de2eaeea..8ef93af2 100644 --- a/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/async_client.py +++ b/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/async_client.py @@ -97,7 +97,9 @@ def __init__( """ self._client = PolicyTagManagerClient( - credentials=credentials, transport=transport, client_options=client_options, + credentials=credentials, + transport=transport, + client_options=client_options, ) async def create_taxonomy( @@ -180,7 +182,12 @@ async def create_taxonomy( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -249,7 +256,10 @@ async def delete_taxonomy( # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def update_taxonomy( @@ -325,7 +335,12 @@ async def update_taxonomy( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -400,12 +415,20 @@ async def list_taxonomies( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListTaxonomiesAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -482,7 +505,12 @@ async def get_taxonomy( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -568,7 +596,12 @@ async def create_policy_tag( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -636,7 +669,10 @@ async def delete_policy_tag( # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def update_policy_tag( @@ -714,7 +750,12 @@ async def update_policy_tag( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -788,12 +829,20 @@ async def list_policy_tags( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListPolicyTagsAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -871,7 +920,12 @@ async def get_policy_tag( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -988,7 +1042,12 @@ async def get_iam_policy( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1105,7 +1164,12 @@ async def set_iam_policy( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1158,7 +1222,12 @@ async def test_iam_permissions( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response diff --git a/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/client.py b/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/client.py index ac3eec4d..616d0f02 100644 --- a/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/client.py +++ b/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/client.py @@ -54,7 +54,10 @@ class PolicyTagManagerClientMeta(type): _transport_registry["grpc"] = PolicyTagManagerGrpcTransport _transport_registry["grpc_asyncio"] = PolicyTagManagerGrpcAsyncIOTransport - def get_transport_class(cls, label: str = None,) -> Type[PolicyTagManagerTransport]: + def get_transport_class( + cls, + label: str = None, + ) -> Type[PolicyTagManagerTransport]: """Return an appropriate transport class. Args: @@ -134,7 +137,10 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): @staticmethod def policy_tag_path( - project: str, location: str, taxonomy: str, policy_tag: str, + project: str, + location: str, + taxonomy: str, + policy_tag: str, ) -> str: """Return a fully-qualified policy_tag string.""" return "projects/{project}/locations/{location}/taxonomies/{taxonomy}/policyTags/{policy_tag}".format( @@ -154,10 +160,16 @@ def parse_policy_tag_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def taxonomy_path(project: str, location: str, taxonomy: str,) -> str: + def taxonomy_path( + project: str, + location: str, + taxonomy: str, + ) -> str: """Return a fully-qualified taxonomy string.""" return "projects/{project}/locations/{location}/taxonomies/{taxonomy}".format( - project=project, location=location, taxonomy=taxonomy, + project=project, + location=location, + taxonomy=taxonomy, ) @staticmethod @@ -341,7 +353,12 @@ def create_taxonomy( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -412,7 +429,10 @@ def delete_taxonomy( # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def update_taxonomy( @@ -490,7 +510,12 @@ def update_taxonomy( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -567,12 +592,20 @@ def list_taxonomies( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListTaxonomiesPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -651,7 +684,12 @@ def get_taxonomy( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -739,7 +777,12 @@ def create_policy_tag( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -809,7 +852,10 @@ def delete_policy_tag( # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def update_policy_tag( @@ -889,7 +935,12 @@ def update_policy_tag( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -965,12 +1016,20 @@ def list_policy_tags( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListPolicyTagsPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1050,7 +1109,12 @@ def get_policy_tag( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1163,7 +1227,12 @@ def get_iam_policy( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1276,7 +1345,12 @@ def set_iam_policy( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1325,7 +1399,12 @@ def test_iam_permissions( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response diff --git a/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/transports/base.py b/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/transports/base.py index abca4532..7aac4291 100644 --- a/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/transports/base.py +++ b/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/transports/base.py @@ -104,40 +104,64 @@ def _prep_wrapped_messages(self): # Precompute the wrapped methods. self._wrapped_methods = { self.create_taxonomy: gapic_v1.method.wrap_method( - self.create_taxonomy, default_timeout=None, client_info=_client_info, + self.create_taxonomy, + default_timeout=None, + client_info=_client_info, ), self.delete_taxonomy: gapic_v1.method.wrap_method( - self.delete_taxonomy, default_timeout=None, client_info=_client_info, + self.delete_taxonomy, + default_timeout=None, + client_info=_client_info, ), self.update_taxonomy: gapic_v1.method.wrap_method( - self.update_taxonomy, default_timeout=None, client_info=_client_info, + self.update_taxonomy, + default_timeout=None, + client_info=_client_info, ), self.list_taxonomies: gapic_v1.method.wrap_method( - self.list_taxonomies, default_timeout=None, client_info=_client_info, + self.list_taxonomies, + default_timeout=None, + client_info=_client_info, ), self.get_taxonomy: gapic_v1.method.wrap_method( - self.get_taxonomy, default_timeout=None, client_info=_client_info, + self.get_taxonomy, + default_timeout=None, + client_info=_client_info, ), self.create_policy_tag: gapic_v1.method.wrap_method( - self.create_policy_tag, default_timeout=None, client_info=_client_info, + self.create_policy_tag, + default_timeout=None, + client_info=_client_info, ), self.delete_policy_tag: gapic_v1.method.wrap_method( - self.delete_policy_tag, default_timeout=None, client_info=_client_info, + self.delete_policy_tag, + default_timeout=None, + client_info=_client_info, ), self.update_policy_tag: gapic_v1.method.wrap_method( - self.update_policy_tag, default_timeout=None, client_info=_client_info, + self.update_policy_tag, + default_timeout=None, + client_info=_client_info, ), self.list_policy_tags: gapic_v1.method.wrap_method( - self.list_policy_tags, default_timeout=None, client_info=_client_info, + self.list_policy_tags, + default_timeout=None, + client_info=_client_info, ), self.get_policy_tag: gapic_v1.method.wrap_method( - self.get_policy_tag, default_timeout=None, client_info=_client_info, + self.get_policy_tag, + default_timeout=None, + client_info=_client_info, ), self.get_iam_policy: gapic_v1.method.wrap_method( - self.get_iam_policy, default_timeout=None, client_info=_client_info, + self.get_iam_policy, + default_timeout=None, + client_info=_client_info, ), self.set_iam_policy: gapic_v1.method.wrap_method( - self.set_iam_policy, default_timeout=None, client_info=_client_info, + self.set_iam_policy, + default_timeout=None, + client_info=_client_info, ), self.test_iam_permissions: gapic_v1.method.wrap_method( self.test_iam_permissions, diff --git a/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/transports/grpc.py b/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/transports/grpc.py index d7fc35f0..8011fade 100644 --- a/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/transports/grpc.py +++ b/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/transports/grpc.py @@ -201,7 +201,8 @@ def grpc_channel(self) -> grpc.Channel: # have one. if not hasattr(self, "_grpc_channel"): self._grpc_channel = self.create_channel( - self._host, credentials=self._credentials, + self._host, + credentials=self._credentials, ) # Return the channel from cache. diff --git a/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/transports/grpc_asyncio.py b/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/transports/grpc_asyncio.py index 217f0a87..f921a947 100644 --- a/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/transports/grpc_asyncio.py +++ b/google/cloud/datacatalog_v1beta1/services/policy_tag_manager/transports/grpc_asyncio.py @@ -194,7 +194,8 @@ def grpc_channel(self) -> aio.Channel: # have one. if not hasattr(self, "_grpc_channel"): self._grpc_channel = self.create_channel( - self._host, credentials=self._credentials, + self._host, + credentials=self._credentials, ) # Return the channel from cache. diff --git a/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/async_client.py b/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/async_client.py index 474cc182..e4a9954d 100644 --- a/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/async_client.py +++ b/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/async_client.py @@ -95,7 +95,9 @@ def __init__( """ self._client = PolicyTagManagerSerializationClient( - credentials=credentials, transport=transport, client_options=client_options, + credentials=credentials, + transport=transport, + client_options=client_options, ) async def import_taxonomies( @@ -148,7 +150,12 @@ async def import_taxonomies( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -203,7 +210,12 @@ async def export_taxonomies( ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response diff --git a/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/client.py b/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/client.py index 445d151d..a74116f5 100644 --- a/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/client.py +++ b/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/client.py @@ -55,7 +55,8 @@ class PolicyTagManagerSerializationClientMeta(type): ] = PolicyTagManagerSerializationGrpcAsyncIOTransport def get_transport_class( - cls, label: str = None, + cls, + label: str = None, ) -> Type[PolicyTagManagerSerializationTransport]: """Return an appropriate transport class. @@ -280,7 +281,12 @@ def import_taxonomies( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -338,7 +344,12 @@ def export_taxonomies( ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response diff --git a/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/transports/base.py b/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/transports/base.py index 26360d93..03d312ec 100644 --- a/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/transports/base.py +++ b/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/transports/base.py @@ -101,10 +101,14 @@ def _prep_wrapped_messages(self): # Precompute the wrapped methods. self._wrapped_methods = { self.import_taxonomies: gapic_v1.method.wrap_method( - self.import_taxonomies, default_timeout=None, client_info=_client_info, + self.import_taxonomies, + default_timeout=None, + client_info=_client_info, ), self.export_taxonomies: gapic_v1.method.wrap_method( - self.export_taxonomies, default_timeout=None, client_info=_client_info, + self.export_taxonomies, + default_timeout=None, + client_info=_client_info, ), } diff --git a/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/transports/grpc.py b/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/transports/grpc.py index d2d74539..eea71701 100644 --- a/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/transports/grpc.py +++ b/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/transports/grpc.py @@ -201,7 +201,8 @@ def grpc_channel(self) -> grpc.Channel: # have one. if not hasattr(self, "_grpc_channel"): self._grpc_channel = self.create_channel( - self._host, credentials=self._credentials, + self._host, + credentials=self._credentials, ) # Return the channel from cache. diff --git a/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/transports/grpc_asyncio.py b/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/transports/grpc_asyncio.py index 8e47b76f..aeaea79e 100644 --- a/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/transports/grpc_asyncio.py +++ b/google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/transports/grpc_asyncio.py @@ -194,7 +194,8 @@ def grpc_channel(self) -> aio.Channel: # have one. if not hasattr(self, "_grpc_channel"): self._grpc_channel = self.create_channel( - self._host, credentials=self._credentials, + self._host, + credentials=self._credentials, ) # Return the channel from cache. diff --git a/google/cloud/datacatalog_v1beta1/types/common.py b/google/cloud/datacatalog_v1beta1/types/common.py index 73167f1e..abd3b274 100644 --- a/google/cloud/datacatalog_v1beta1/types/common.py +++ b/google/cloud/datacatalog_v1beta1/types/common.py @@ -19,7 +19,10 @@ __protobuf__ = proto.module( - package="google.cloud.datacatalog.v1beta1", manifest={"IntegratedSystem",}, + package="google.cloud.datacatalog.v1beta1", + manifest={ + "IntegratedSystem", + }, ) diff --git a/google/cloud/datacatalog_v1beta1/types/datacatalog.py b/google/cloud/datacatalog_v1beta1/types/datacatalog.py index 7bbbae2f..c41166c6 100644 --- a/google/cloud/datacatalog_v1beta1/types/datacatalog.py +++ b/google/cloud/datacatalog_v1beta1/types/datacatalog.py @@ -156,7 +156,11 @@ class Scope(proto.Message): include_gcp_public_datasets = proto.Field(proto.BOOL, number=7) - scope = proto.Field(proto.MESSAGE, number=6, message=Scope,) + scope = proto.Field( + proto.MESSAGE, + number=6, + message=Scope, + ) query = proto.Field(proto.STRING, number=1) @@ -184,7 +188,9 @@ def raw_page(self): return self results = proto.RepeatedField( - proto.MESSAGE, number=1, message=search.SearchCatalogResult, + proto.MESSAGE, + number=1, + message=search.SearchCatalogResult, ) next_page_token = proto.Field(proto.STRING, number=3) @@ -218,7 +224,11 @@ class CreateEntryGroupRequest(proto.Message): entry_group_id = proto.Field(proto.STRING, number=3) - entry_group = proto.Field(proto.MESSAGE, number=2, message="EntryGroup",) + entry_group = proto.Field( + proto.MESSAGE, + number=2, + message="EntryGroup", + ) class UpdateEntryGroupRequest(proto.Message): @@ -235,9 +245,17 @@ class UpdateEntryGroupRequest(proto.Message): updated. """ - entry_group = proto.Field(proto.MESSAGE, number=1, message="EntryGroup",) + entry_group = proto.Field( + proto.MESSAGE, + number=1, + message="EntryGroup", + ) - update_mask = proto.Field(proto.MESSAGE, number=2, message=field_mask.FieldMask,) + update_mask = proto.Field( + proto.MESSAGE, + number=2, + message=field_mask.FieldMask, + ) class GetEntryGroupRequest(proto.Message): @@ -255,7 +273,11 @@ class GetEntryGroupRequest(proto.Message): name = proto.Field(proto.STRING, number=1) - read_mask = proto.Field(proto.MESSAGE, number=2, message=field_mask.FieldMask,) + read_mask = proto.Field( + proto.MESSAGE, + number=2, + message=field_mask.FieldMask, + ) class DeleteEntryGroupRequest(proto.Message): @@ -319,7 +341,11 @@ class ListEntryGroupsResponse(proto.Message): def raw_page(self): return self - entry_groups = proto.RepeatedField(proto.MESSAGE, number=1, message="EntryGroup",) + entry_groups = proto.RepeatedField( + proto.MESSAGE, + number=1, + message="EntryGroup", + ) next_page_token = proto.Field(proto.STRING, number=2) @@ -347,7 +373,11 @@ class CreateEntryRequest(proto.Message): entry_id = proto.Field(proto.STRING, number=3) - entry = proto.Field(proto.MESSAGE, number=2, message="Entry",) + entry = proto.Field( + proto.MESSAGE, + number=2, + message="Entry", + ) class UpdateEntryRequest(proto.Message): @@ -387,9 +417,17 @@ class UpdateEntryRequest(proto.Message): - source_system_timestamps """ - entry = proto.Field(proto.MESSAGE, number=1, message="Entry",) + entry = proto.Field( + proto.MESSAGE, + number=1, + message="Entry", + ) - update_mask = proto.Field(proto.MESSAGE, number=2, message=field_mask.FieldMask,) + update_mask = proto.Field( + proto.MESSAGE, + number=2, + message=field_mask.FieldMask, + ) class DeleteEntryRequest(proto.Message): @@ -555,12 +593,20 @@ class Entry(proto.Message): linked_resource = proto.Field(proto.STRING, number=9) - type = proto.Field(proto.ENUM, number=2, oneof="entry_type", enum="EntryType",) + type = proto.Field( + proto.ENUM, + number=2, + oneof="entry_type", + enum="EntryType", + ) user_specified_type = proto.Field(proto.STRING, number=16, oneof="entry_type") integrated_system = proto.Field( - proto.ENUM, number=17, oneof="system", enum=common.IntegratedSystem, + proto.ENUM, + number=17, + oneof="system", + enum=common.IntegratedSystem, ) user_specified_system = proto.Field(proto.STRING, number=18, oneof="system") @@ -590,10 +636,16 @@ class Entry(proto.Message): description = proto.Field(proto.STRING, number=4) - schema = proto.Field(proto.MESSAGE, number=5, message=gcd_schema.Schema,) + schema = proto.Field( + proto.MESSAGE, + number=5, + message=gcd_schema.Schema, + ) source_system_timestamps = proto.Field( - proto.MESSAGE, number=7, message=timestamps.SystemTimestamps, + proto.MESSAGE, + number=7, + message=timestamps.SystemTimestamps, ) @@ -631,7 +683,9 @@ class EntryGroup(proto.Message): description = proto.Field(proto.STRING, number=3) data_catalog_timestamps = proto.Field( - proto.MESSAGE, number=4, message=timestamps.SystemTimestamps, + proto.MESSAGE, + number=4, + message=timestamps.SystemTimestamps, ) @@ -658,7 +712,11 @@ class CreateTagTemplateRequest(proto.Message): tag_template_id = proto.Field(proto.STRING, number=3) - tag_template = proto.Field(proto.MESSAGE, number=2, message=gcd_tags.TagTemplate,) + tag_template = proto.Field( + proto.MESSAGE, + number=2, + message=gcd_tags.TagTemplate, + ) class GetTagTemplateRequest(proto.Message): @@ -695,9 +753,17 @@ class UpdateTagTemplateRequest(proto.Message): updated. """ - tag_template = proto.Field(proto.MESSAGE, number=1, message=gcd_tags.TagTemplate,) + tag_template = proto.Field( + proto.MESSAGE, + number=1, + message=gcd_tags.TagTemplate, + ) - update_mask = proto.Field(proto.MESSAGE, number=2, message=field_mask.FieldMask,) + update_mask = proto.Field( + proto.MESSAGE, + number=2, + message=field_mask.FieldMask, + ) class DeleteTagTemplateRequest(proto.Message): @@ -740,7 +806,11 @@ class CreateTagRequest(proto.Message): parent = proto.Field(proto.STRING, number=1) - tag = proto.Field(proto.MESSAGE, number=2, message=gcd_tags.Tag,) + tag = proto.Field( + proto.MESSAGE, + number=2, + message=gcd_tags.Tag, + ) class UpdateTagRequest(proto.Message): @@ -757,9 +827,17 @@ class UpdateTagRequest(proto.Message): field is the field ``fields``. """ - tag = proto.Field(proto.MESSAGE, number=1, message=gcd_tags.Tag,) + tag = proto.Field( + proto.MESSAGE, + number=1, + message=gcd_tags.Tag, + ) - update_mask = proto.Field(proto.MESSAGE, number=2, message=field_mask.FieldMask,) + update_mask = proto.Field( + proto.MESSAGE, + number=2, + message=field_mask.FieldMask, + ) class DeleteTagRequest(proto.Message): @@ -803,7 +881,9 @@ class CreateTagTemplateFieldRequest(proto.Message): tag_template_field_id = proto.Field(proto.STRING, number=2) tag_template_field = proto.Field( - proto.MESSAGE, number=3, message=gcd_tags.TagTemplateField, + proto.MESSAGE, + number=3, + message=gcd_tags.TagTemplateField, ) @@ -839,10 +919,16 @@ class UpdateTagTemplateFieldRequest(proto.Message): name = proto.Field(proto.STRING, number=1) tag_template_field = proto.Field( - proto.MESSAGE, number=2, message=gcd_tags.TagTemplateField, + proto.MESSAGE, + number=2, + message=gcd_tags.TagTemplateField, ) - update_mask = proto.Field(proto.MESSAGE, number=3, message=field_mask.FieldMask,) + update_mask = proto.Field( + proto.MESSAGE, + number=3, + message=field_mask.FieldMask, + ) class RenameTagTemplateFieldRequest(proto.Message): @@ -933,7 +1019,11 @@ class ListTagsResponse(proto.Message): def raw_page(self): return self - tags = proto.RepeatedField(proto.MESSAGE, number=1, message=gcd_tags.Tag,) + tags = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=gcd_tags.Tag, + ) next_page_token = proto.Field(proto.STRING, number=2) @@ -968,7 +1058,11 @@ class ListEntriesRequest(proto.Message): page_token = proto.Field(proto.STRING, number=3) - read_mask = proto.Field(proto.MESSAGE, number=4, message=field_mask.FieldMask,) + read_mask = proto.Field( + proto.MESSAGE, + number=4, + message=field_mask.FieldMask, + ) class ListEntriesResponse(proto.Message): @@ -988,7 +1082,11 @@ class ListEntriesResponse(proto.Message): def raw_page(self): return self - entries = proto.RepeatedField(proto.MESSAGE, number=1, message=Entry,) + entries = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=Entry, + ) next_page_token = proto.Field(proto.STRING, number=2) diff --git a/google/cloud/datacatalog_v1beta1/types/gcs_fileset_spec.py b/google/cloud/datacatalog_v1beta1/types/gcs_fileset_spec.py index cc52615b..c19a7e30 100644 --- a/google/cloud/datacatalog_v1beta1/types/gcs_fileset_spec.py +++ b/google/cloud/datacatalog_v1beta1/types/gcs_fileset_spec.py @@ -23,7 +23,10 @@ __protobuf__ = proto.module( package="google.cloud.datacatalog.v1beta1", - manifest={"GcsFilesetSpec", "GcsFileSpec",}, + manifest={ + "GcsFilesetSpec", + "GcsFileSpec", + }, ) @@ -73,7 +76,9 @@ class GcsFilesetSpec(proto.Message): file_patterns = proto.RepeatedField(proto.STRING, number=1) sample_gcs_file_specs = proto.RepeatedField( - proto.MESSAGE, number=2, message="GcsFileSpec", + proto.MESSAGE, + number=2, + message="GcsFileSpec", ) @@ -94,7 +99,9 @@ class GcsFileSpec(proto.Message): file_path = proto.Field(proto.STRING, number=1) gcs_timestamps = proto.Field( - proto.MESSAGE, number=2, message=timestamps.SystemTimestamps, + proto.MESSAGE, + number=2, + message=timestamps.SystemTimestamps, ) size_bytes = proto.Field(proto.INT64, number=4) diff --git a/google/cloud/datacatalog_v1beta1/types/policytagmanager.py b/google/cloud/datacatalog_v1beta1/types/policytagmanager.py index 259be1b3..15416383 100644 --- a/google/cloud/datacatalog_v1beta1/types/policytagmanager.py +++ b/google/cloud/datacatalog_v1beta1/types/policytagmanager.py @@ -84,7 +84,11 @@ class PolicyType(proto.Enum): description = proto.Field(proto.STRING, number=3) - activated_policy_types = proto.RepeatedField(proto.ENUM, number=6, enum=PolicyType,) + activated_policy_types = proto.RepeatedField( + proto.ENUM, + number=6, + enum=PolicyType, + ) class PolicyTag(proto.Message): @@ -152,7 +156,11 @@ class CreateTaxonomyRequest(proto.Message): parent = proto.Field(proto.STRING, number=1) - taxonomy = proto.Field(proto.MESSAGE, number=2, message=Taxonomy,) + taxonomy = proto.Field( + proto.MESSAGE, + number=2, + message=Taxonomy, + ) class DeleteTaxonomyRequest(proto.Message): @@ -185,9 +193,17 @@ class UpdateTaxonomyRequest(proto.Message): to update. """ - taxonomy = proto.Field(proto.MESSAGE, number=1, message=Taxonomy,) + taxonomy = proto.Field( + proto.MESSAGE, + number=1, + message=Taxonomy, + ) - update_mask = proto.Field(proto.MESSAGE, number=2, message=field_mask.FieldMask,) + update_mask = proto.Field( + proto.MESSAGE, + number=2, + message=field_mask.FieldMask, + ) class ListTaxonomiesRequest(proto.Message): @@ -231,7 +247,11 @@ class ListTaxonomiesResponse(proto.Message): def raw_page(self): return self - taxonomies = proto.RepeatedField(proto.MESSAGE, number=1, message=Taxonomy,) + taxonomies = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=Taxonomy, + ) next_page_token = proto.Field(proto.STRING, number=2) @@ -263,7 +283,11 @@ class CreatePolicyTagRequest(proto.Message): parent = proto.Field(proto.STRING, number=1) - policy_tag = proto.Field(proto.MESSAGE, number=2, message=PolicyTag,) + policy_tag = proto.Field( + proto.MESSAGE, + number=2, + message=PolicyTag, + ) class DeletePolicyTagRequest(proto.Message): @@ -300,9 +324,17 @@ class UpdatePolicyTagRequest(proto.Message): to update. """ - policy_tag = proto.Field(proto.MESSAGE, number=1, message=PolicyTag,) + policy_tag = proto.Field( + proto.MESSAGE, + number=1, + message=PolicyTag, + ) - update_mask = proto.Field(proto.MESSAGE, number=2, message=field_mask.FieldMask,) + update_mask = proto.Field( + proto.MESSAGE, + number=2, + message=field_mask.FieldMask, + ) class ListPolicyTagsRequest(proto.Message): @@ -347,7 +379,11 @@ class ListPolicyTagsResponse(proto.Message): def raw_page(self): return self - policy_tags = proto.RepeatedField(proto.MESSAGE, number=1, message=PolicyTag,) + policy_tags = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=PolicyTag, + ) next_page_token = proto.Field(proto.STRING, number=2) diff --git a/google/cloud/datacatalog_v1beta1/types/policytagmanagerserialization.py b/google/cloud/datacatalog_v1beta1/types/policytagmanagerserialization.py index dd14cd86..bd10e89d 100644 --- a/google/cloud/datacatalog_v1beta1/types/policytagmanagerserialization.py +++ b/google/cloud/datacatalog_v1beta1/types/policytagmanagerserialization.py @@ -58,7 +58,9 @@ class SerializedTaxonomy(proto.Message): description = proto.Field(proto.STRING, number=2) policy_tags = proto.RepeatedField( - proto.MESSAGE, number=3, message="SerializedPolicyTag", + proto.MESSAGE, + number=3, + message="SerializedPolicyTag", ) @@ -84,7 +86,9 @@ class SerializedPolicyTag(proto.Message): description = proto.Field(proto.STRING, number=3) child_policy_tags = proto.RepeatedField( - proto.MESSAGE, number=4, message="SerializedPolicyTag", + proto.MESSAGE, + number=4, + message="SerializedPolicyTag", ) @@ -103,7 +107,10 @@ class ImportTaxonomiesRequest(proto.Message): parent = proto.Field(proto.STRING, number=1) inline_source = proto.Field( - proto.MESSAGE, number=2, oneof="source", message="InlineSource", + proto.MESSAGE, + number=2, + oneof="source", + message="InlineSource", ) @@ -116,7 +123,9 @@ class InlineSource(proto.Message): """ taxonomies = proto.RepeatedField( - proto.MESSAGE, number=1, message=SerializedTaxonomy, + proto.MESSAGE, + number=1, + message=SerializedTaxonomy, ) @@ -130,7 +139,9 @@ class ImportTaxonomiesResponse(proto.Message): """ taxonomies = proto.RepeatedField( - proto.MESSAGE, number=1, message=policytagmanager.Taxonomy, + proto.MESSAGE, + number=1, + message=policytagmanager.Taxonomy, ) @@ -167,7 +178,9 @@ class ExportTaxonomiesResponse(proto.Message): """ taxonomies = proto.RepeatedField( - proto.MESSAGE, number=1, message=SerializedTaxonomy, + proto.MESSAGE, + number=1, + message=SerializedTaxonomy, ) diff --git a/google/cloud/datacatalog_v1beta1/types/schema.py b/google/cloud/datacatalog_v1beta1/types/schema.py index 55014c32..fd7001b6 100644 --- a/google/cloud/datacatalog_v1beta1/types/schema.py +++ b/google/cloud/datacatalog_v1beta1/types/schema.py @@ -19,7 +19,11 @@ __protobuf__ = proto.module( - package="google.cloud.datacatalog.v1beta1", manifest={"Schema", "ColumnSchema",}, + package="google.cloud.datacatalog.v1beta1", + manifest={ + "Schema", + "ColumnSchema", + }, ) @@ -32,7 +36,11 @@ class Schema(proto.Message): 10,000 columns and sub-columns can be specified. """ - columns = proto.RepeatedField(proto.MESSAGE, number=2, message="ColumnSchema",) + columns = proto.RepeatedField( + proto.MESSAGE, + number=2, + message="ColumnSchema", + ) class ColumnSchema(proto.Message): @@ -65,7 +73,11 @@ class ColumnSchema(proto.Message): mode = proto.Field(proto.STRING, number=3) - subcolumns = proto.RepeatedField(proto.MESSAGE, number=7, message="ColumnSchema",) + subcolumns = proto.RepeatedField( + proto.MESSAGE, + number=7, + message="ColumnSchema", + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/datacatalog_v1beta1/types/search.py b/google/cloud/datacatalog_v1beta1/types/search.py index 87f828d2..5adc511b 100644 --- a/google/cloud/datacatalog_v1beta1/types/search.py +++ b/google/cloud/datacatalog_v1beta1/types/search.py @@ -20,7 +20,10 @@ __protobuf__ = proto.module( package="google.cloud.datacatalog.v1beta1", - manifest={"SearchResultType", "SearchCatalogResult",}, + manifest={ + "SearchResultType", + "SearchCatalogResult", + }, ) @@ -65,7 +68,11 @@ class SearchCatalogResult(proto.Message): - ``//bigquery.googleapis.com/projects/projectId/datasets/datasetId/tables/tableId`` """ - search_result_type = proto.Field(proto.ENUM, number=1, enum="SearchResultType",) + search_result_type = proto.Field( + proto.ENUM, + number=1, + enum="SearchResultType", + ) search_result_subtype = proto.Field(proto.STRING, number=2) diff --git a/google/cloud/datacatalog_v1beta1/types/table_spec.py b/google/cloud/datacatalog_v1beta1/types/table_spec.py index 254afd21..136d64ff 100644 --- a/google/cloud/datacatalog_v1beta1/types/table_spec.py +++ b/google/cloud/datacatalog_v1beta1/types/table_spec.py @@ -51,14 +51,24 @@ class BigQueryTableSpec(proto.Message): populated if ``table_source_type`` is ``BIGQUERY_TABLE``. """ - table_source_type = proto.Field(proto.ENUM, number=1, enum="TableSourceType",) + table_source_type = proto.Field( + proto.ENUM, + number=1, + enum="TableSourceType", + ) view_spec = proto.Field( - proto.MESSAGE, number=2, oneof="type_spec", message="ViewSpec", + proto.MESSAGE, + number=2, + oneof="type_spec", + message="ViewSpec", ) table_spec = proto.Field( - proto.MESSAGE, number=3, oneof="type_spec", message="TableSpec", + proto.MESSAGE, + number=3, + oneof="type_spec", + message="TableSpec", ) diff --git a/google/cloud/datacatalog_v1beta1/types/tags.py b/google/cloud/datacatalog_v1beta1/types/tags.py index ddd5cf1f..7e12c83c 100644 --- a/google/cloud/datacatalog_v1beta1/types/tags.py +++ b/google/cloud/datacatalog_v1beta1/types/tags.py @@ -23,7 +23,13 @@ __protobuf__ = proto.module( package="google.cloud.datacatalog.v1beta1", - manifest={"Tag", "TagField", "TagTemplate", "TagTemplateField", "FieldType",}, + manifest={ + "Tag", + "TagField", + "TagTemplate", + "TagTemplateField", + "FieldType", + }, ) @@ -79,7 +85,12 @@ class Tag(proto.Message): column = proto.Field(proto.STRING, number=4, oneof="scope") - fields = proto.MapField(proto.STRING, proto.MESSAGE, number=3, message="TagField",) + fields = proto.MapField( + proto.STRING, + proto.MESSAGE, + number=3, + message="TagField", + ) class TagField(proto.Message): @@ -134,10 +145,18 @@ class EnumValue(proto.Message): bool_value = proto.Field(proto.BOOL, number=4, oneof="kind") timestamp_value = proto.Field( - proto.MESSAGE, number=5, oneof="kind", message=timestamp.Timestamp, + proto.MESSAGE, + number=5, + oneof="kind", + message=timestamp.Timestamp, ) - enum_value = proto.Field(proto.MESSAGE, number=6, oneof="kind", message=EnumValue,) + enum_value = proto.Field( + proto.MESSAGE, + number=6, + oneof="kind", + message=EnumValue, + ) order = proto.Field(proto.INT32, number=7) @@ -183,7 +202,10 @@ class TagTemplate(proto.Message): display_name = proto.Field(proto.STRING, number=2) fields = proto.MapField( - proto.STRING, proto.MESSAGE, number=3, message="TagTemplateField", + proto.STRING, + proto.MESSAGE, + number=3, + message="TagTemplateField", ) @@ -221,7 +243,11 @@ class TagTemplateField(proto.Message): display_name = proto.Field(proto.STRING, number=1) - type = proto.Field(proto.MESSAGE, number=2, message="FieldType",) + type = proto.Field( + proto.MESSAGE, + number=2, + message="FieldType", + ) is_required = proto.Field(proto.BOOL, number=3) @@ -276,15 +302,23 @@ class EnumValue(proto.Message): display_name = proto.Field(proto.STRING, number=1) allowed_values = proto.RepeatedField( - proto.MESSAGE, number=1, message="FieldType.EnumType.EnumValue", + proto.MESSAGE, + number=1, + message="FieldType.EnumType.EnumValue", ) primitive_type = proto.Field( - proto.ENUM, number=1, oneof="type_decl", enum=PrimitiveType, + proto.ENUM, + number=1, + oneof="type_decl", + enum=PrimitiveType, ) enum_type = proto.Field( - proto.MESSAGE, number=2, oneof="type_decl", message=EnumType, + proto.MESSAGE, + number=2, + oneof="type_decl", + message=EnumType, ) diff --git a/google/cloud/datacatalog_v1beta1/types/timestamps.py b/google/cloud/datacatalog_v1beta1/types/timestamps.py index 82ef8a06..cb341467 100644 --- a/google/cloud/datacatalog_v1beta1/types/timestamps.py +++ b/google/cloud/datacatalog_v1beta1/types/timestamps.py @@ -22,7 +22,10 @@ __protobuf__ = proto.module( - package="google.cloud.datacatalog.v1beta1", manifest={"SystemTimestamps",}, + package="google.cloud.datacatalog.v1beta1", + manifest={ + "SystemTimestamps", + }, ) @@ -43,11 +46,23 @@ class SystemTimestamps(proto.Message): apllicable to BigQuery resources. """ - create_time = proto.Field(proto.MESSAGE, number=1, message=timestamp.Timestamp,) + create_time = proto.Field( + proto.MESSAGE, + number=1, + message=timestamp.Timestamp, + ) - update_time = proto.Field(proto.MESSAGE, number=2, message=timestamp.Timestamp,) + update_time = proto.Field( + proto.MESSAGE, + number=2, + message=timestamp.Timestamp, + ) - expire_time = proto.Field(proto.MESSAGE, number=3, message=timestamp.Timestamp,) + expire_time = proto.Field( + proto.MESSAGE, + number=3, + message=timestamp.Timestamp, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/noxfile.py b/noxfile.py index d32025c7..0429e213 100644 --- a/noxfile.py +++ b/noxfile.py @@ -23,13 +23,16 @@ import nox -BLACK_VERSION = "black==19.10b0" +BLACK_VERSION = "black==22.3.0" BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] DEFAULT_PYTHON_VERSION = "3.8" SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"] UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8"] +# Error if a python version is missing +nox.options.error_on_missing_interpreters = True + @nox.session(python=DEFAULT_PYTHON_VERSION) def lint(session): @@ -40,12 +43,14 @@ def lint(session): """ session.install("flake8", BLACK_VERSION) session.run( - "black", "--check", *BLACK_PATHS, + "black", + "--check", + *BLACK_PATHS, ) session.run("flake8", "google", "tests") -@nox.session(python="3.6") +@nox.session(python=DEFAULT_PYTHON_VERSION) def blacken(session): """Run black. @@ -57,7 +62,8 @@ def blacken(session): """ session.install(BLACK_VERSION) session.run( - "black", *BLACK_PATHS, + "black", + *BLACK_PATHS, ) @@ -122,7 +128,9 @@ def system(session): # Install all test dependencies, then install this package into the # virtualenv's dist-packages. session.install( - "mock", "pytest", "google-cloud-testutils", + "mock", + "pytest", + "google-cloud-testutils", ) session.install("-e", ".") diff --git a/tests/unit/gapic/datacatalog_v1/test_data_catalog.py b/tests/unit/gapic/datacatalog_v1/test_data_catalog.py index 79523fa6..2cbbabfa 100644 --- a/tests/unit/gapic/datacatalog_v1/test_data_catalog.py +++ b/tests/unit/gapic/datacatalog_v1/test_data_catalog.py @@ -297,7 +297,9 @@ def test_data_catalog_client_client_options_scopes( client_class, transport_class, transport_name ): # Check the case scopes are provided. - options = client_options.ClientOptions(scopes=["1", "2"],) + options = client_options.ClientOptions( + scopes=["1", "2"], + ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options) @@ -363,7 +365,8 @@ def test_search_catalog( transport: str = "grpc", request_type=datacatalog.SearchCatalogRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -374,7 +377,8 @@ def test_search_catalog( with mock.patch.object(type(client._transport.search_catalog), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = datacatalog.SearchCatalogResponse( - next_page_token="next_page_token_value", unreachable=["unreachable_value"], + next_page_token="next_page_token_value", + unreachable=["unreachable_value"], ) response = client.search_catalog(request) @@ -400,7 +404,8 @@ def test_search_catalog_from_dict(): @pytest.mark.asyncio async def test_search_catalog_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -436,7 +441,9 @@ async def test_search_catalog_async(transport: str = "grpc_asyncio"): def test_search_catalog_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.search_catalog), "__call__") as call: @@ -465,7 +472,9 @@ def test_search_catalog_flattened(): def test_search_catalog_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -481,7 +490,9 @@ def test_search_catalog_flattened_error(): @pytest.mark.asyncio async def test_search_catalog_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -516,7 +527,9 @@ async def test_search_catalog_flattened_async(): @pytest.mark.asyncio async def test_search_catalog_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -531,7 +544,9 @@ async def test_search_catalog_flattened_error_async(): def test_search_catalog_pager(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.search_catalog), "__call__") as call: @@ -545,12 +560,21 @@ def test_search_catalog_pager(): ], next_page_token="abc", ), - datacatalog.SearchCatalogResponse(results=[], next_page_token="def",), datacatalog.SearchCatalogResponse( - results=[search.SearchCatalogResult(),], next_page_token="ghi", + results=[], + next_page_token="def", + ), + datacatalog.SearchCatalogResponse( + results=[ + search.SearchCatalogResult(), + ], + next_page_token="ghi", ), datacatalog.SearchCatalogResponse( - results=[search.SearchCatalogResult(), search.SearchCatalogResult(),], + results=[ + search.SearchCatalogResult(), + search.SearchCatalogResult(), + ], ), RuntimeError, ) @@ -566,7 +590,9 @@ def test_search_catalog_pager(): def test_search_catalog_pages(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.search_catalog), "__call__") as call: @@ -580,12 +606,21 @@ def test_search_catalog_pages(): ], next_page_token="abc", ), - datacatalog.SearchCatalogResponse(results=[], next_page_token="def",), datacatalog.SearchCatalogResponse( - results=[search.SearchCatalogResult(),], next_page_token="ghi", + results=[], + next_page_token="def", ), datacatalog.SearchCatalogResponse( - results=[search.SearchCatalogResult(), search.SearchCatalogResult(),], + results=[ + search.SearchCatalogResult(), + ], + next_page_token="ghi", + ), + datacatalog.SearchCatalogResponse( + results=[ + search.SearchCatalogResult(), + search.SearchCatalogResult(), + ], ), RuntimeError, ) @@ -596,7 +631,9 @@ def test_search_catalog_pages(): @pytest.mark.asyncio async def test_search_catalog_async_pager(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -614,16 +651,27 @@ async def test_search_catalog_async_pager(): ], next_page_token="abc", ), - datacatalog.SearchCatalogResponse(results=[], next_page_token="def",), datacatalog.SearchCatalogResponse( - results=[search.SearchCatalogResult(),], next_page_token="ghi", + results=[], + next_page_token="def", + ), + datacatalog.SearchCatalogResponse( + results=[ + search.SearchCatalogResult(), + ], + next_page_token="ghi", ), datacatalog.SearchCatalogResponse( - results=[search.SearchCatalogResult(), search.SearchCatalogResult(),], + results=[ + search.SearchCatalogResult(), + search.SearchCatalogResult(), + ], ), RuntimeError, ) - async_pager = await client.search_catalog(request={},) + async_pager = await client.search_catalog( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -635,7 +683,9 @@ async def test_search_catalog_async_pager(): @pytest.mark.asyncio async def test_search_catalog_async_pages(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -653,12 +703,21 @@ async def test_search_catalog_async_pages(): ], next_page_token="abc", ), - datacatalog.SearchCatalogResponse(results=[], next_page_token="def",), datacatalog.SearchCatalogResponse( - results=[search.SearchCatalogResult(),], next_page_token="ghi", + results=[], + next_page_token="def", + ), + datacatalog.SearchCatalogResponse( + results=[ + search.SearchCatalogResult(), + ], + next_page_token="ghi", ), datacatalog.SearchCatalogResponse( - results=[search.SearchCatalogResult(), search.SearchCatalogResult(),], + results=[ + search.SearchCatalogResult(), + search.SearchCatalogResult(), + ], ), RuntimeError, ) @@ -673,7 +732,8 @@ def test_create_entry_group( transport: str = "grpc", request_type=datacatalog.CreateEntryGroupRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -716,7 +776,8 @@ def test_create_entry_group_from_dict(): @pytest.mark.asyncio async def test_create_entry_group_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -755,7 +816,9 @@ async def test_create_entry_group_async(transport: str = "grpc_asyncio"): def test_create_entry_group_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -777,12 +840,17 @@ def test_create_entry_group_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_entry_group_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -806,11 +874,16 @@ async def test_create_entry_group_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_entry_group_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -840,7 +913,9 @@ def test_create_entry_group_flattened(): def test_create_entry_group_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -855,7 +930,9 @@ def test_create_entry_group_flattened_error(): @pytest.mark.asyncio async def test_create_entry_group_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -889,7 +966,9 @@ async def test_create_entry_group_flattened_async(): @pytest.mark.asyncio async def test_create_entry_group_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -906,7 +985,8 @@ def test_get_entry_group( transport: str = "grpc", request_type=datacatalog.GetEntryGroupRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -947,7 +1027,8 @@ def test_get_entry_group_from_dict(): @pytest.mark.asyncio async def test_get_entry_group_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -986,7 +1067,9 @@ async def test_get_entry_group_async(transport: str = "grpc_asyncio"): def test_get_entry_group_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1006,12 +1089,17 @@ def test_get_entry_group_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_entry_group_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1035,11 +1123,16 @@ async def test_get_entry_group_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_entry_group_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.get_entry_group), "__call__") as call: @@ -1049,7 +1142,8 @@ def test_get_entry_group_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.get_entry_group( - name="name_value", read_mask=field_mask.FieldMask(paths=["paths_value"]), + name="name_value", + read_mask=field_mask.FieldMask(paths=["paths_value"]), ) # Establish that the underlying call was made with the expected @@ -1063,7 +1157,9 @@ def test_get_entry_group_flattened(): def test_get_entry_group_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1077,7 +1173,9 @@ def test_get_entry_group_flattened_error(): @pytest.mark.asyncio async def test_get_entry_group_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1092,7 +1190,8 @@ async def test_get_entry_group_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.get_entry_group( - name="name_value", read_mask=field_mask.FieldMask(paths=["paths_value"]), + name="name_value", + read_mask=field_mask.FieldMask(paths=["paths_value"]), ) # Establish that the underlying call was made with the expected @@ -1107,7 +1206,9 @@ async def test_get_entry_group_flattened_async(): @pytest.mark.asyncio async def test_get_entry_group_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1123,7 +1224,8 @@ def test_update_entry_group( transport: str = "grpc", request_type=datacatalog.UpdateEntryGroupRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1166,7 +1268,8 @@ def test_update_entry_group_from_dict(): @pytest.mark.asyncio async def test_update_entry_group_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1205,7 +1308,9 @@ async def test_update_entry_group_async(transport: str = "grpc_asyncio"): def test_update_entry_group_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1227,14 +1332,17 @@ def test_update_entry_group_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "entry_group.name=entry_group.name/value",) in kw[ - "metadata" - ] + assert ( + "x-goog-request-params", + "entry_group.name=entry_group.name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_update_entry_group_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1258,13 +1366,16 @@ async def test_update_entry_group_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "entry_group.name=entry_group.name/value",) in kw[ - "metadata" - ] + assert ( + "x-goog-request-params", + "entry_group.name=entry_group.name/value", + ) in kw["metadata"] def test_update_entry_group_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1291,7 +1402,9 @@ def test_update_entry_group_flattened(): def test_update_entry_group_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1305,7 +1418,9 @@ def test_update_entry_group_flattened_error(): @pytest.mark.asyncio async def test_update_entry_group_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1336,7 +1451,9 @@ async def test_update_entry_group_flattened_async(): @pytest.mark.asyncio async def test_update_entry_group_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1352,7 +1469,8 @@ def test_delete_entry_group( transport: str = "grpc", request_type=datacatalog.DeleteEntryGroupRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1385,7 +1503,8 @@ def test_delete_entry_group_from_dict(): @pytest.mark.asyncio async def test_delete_entry_group_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1412,7 +1531,9 @@ async def test_delete_entry_group_async(transport: str = "grpc_asyncio"): def test_delete_entry_group_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1434,12 +1555,17 @@ def test_delete_entry_group_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_entry_group_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1461,11 +1587,16 @@ async def test_delete_entry_group_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_entry_group_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1476,7 +1607,9 @@ def test_delete_entry_group_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_entry_group(name="name_value",) + client.delete_entry_group( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1487,19 +1620,24 @@ def test_delete_entry_group_flattened(): def test_delete_entry_group_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_entry_group( - datacatalog.DeleteEntryGroupRequest(), name="name_value", + datacatalog.DeleteEntryGroupRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_delete_entry_group_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1511,7 +1649,9 @@ async def test_delete_entry_group_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_entry_group(name="name_value",) + response = await client.delete_entry_group( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1523,13 +1663,16 @@ async def test_delete_entry_group_flattened_async(): @pytest.mark.asyncio async def test_delete_entry_group_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_entry_group( - datacatalog.DeleteEntryGroupRequest(), name="name_value", + datacatalog.DeleteEntryGroupRequest(), + name="name_value", ) @@ -1537,7 +1680,8 @@ def test_list_entry_groups( transport: str = "grpc", request_type=datacatalog.ListEntryGroupsRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1574,7 +1718,8 @@ def test_list_entry_groups_from_dict(): @pytest.mark.asyncio async def test_list_entry_groups_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1607,7 +1752,9 @@ async def test_list_entry_groups_async(transport: str = "grpc_asyncio"): def test_list_entry_groups_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1629,12 +1776,17 @@ def test_list_entry_groups_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_list_entry_groups_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1658,11 +1810,16 @@ async def test_list_entry_groups_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_entry_groups_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1673,7 +1830,9 @@ def test_list_entry_groups_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_entry_groups(parent="parent_value",) + client.list_entry_groups( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1684,19 +1843,24 @@ def test_list_entry_groups_flattened(): def test_list_entry_groups_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_entry_groups( - datacatalog.ListEntryGroupsRequest(), parent="parent_value", + datacatalog.ListEntryGroupsRequest(), + parent="parent_value", ) @pytest.mark.asyncio async def test_list_entry_groups_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1710,7 +1874,9 @@ async def test_list_entry_groups_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_entry_groups(parent="parent_value",) + response = await client.list_entry_groups( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1722,18 +1888,23 @@ async def test_list_entry_groups_flattened_async(): @pytest.mark.asyncio async def test_list_entry_groups_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.list_entry_groups( - datacatalog.ListEntryGroupsRequest(), parent="parent_value", + datacatalog.ListEntryGroupsRequest(), + parent="parent_value", ) def test_list_entry_groups_pager(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1750,13 +1921,20 @@ def test_list_entry_groups_pager(): next_page_token="abc", ), datacatalog.ListEntryGroupsResponse( - entry_groups=[], next_page_token="def", + entry_groups=[], + next_page_token="def", ), datacatalog.ListEntryGroupsResponse( - entry_groups=[datacatalog.EntryGroup(),], next_page_token="ghi", + entry_groups=[ + datacatalog.EntryGroup(), + ], + next_page_token="ghi", ), datacatalog.ListEntryGroupsResponse( - entry_groups=[datacatalog.EntryGroup(), datacatalog.EntryGroup(),], + entry_groups=[ + datacatalog.EntryGroup(), + datacatalog.EntryGroup(), + ], ), RuntimeError, ) @@ -1775,7 +1953,9 @@ def test_list_entry_groups_pager(): def test_list_entry_groups_pages(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1792,13 +1972,20 @@ def test_list_entry_groups_pages(): next_page_token="abc", ), datacatalog.ListEntryGroupsResponse( - entry_groups=[], next_page_token="def", + entry_groups=[], + next_page_token="def", ), datacatalog.ListEntryGroupsResponse( - entry_groups=[datacatalog.EntryGroup(),], next_page_token="ghi", + entry_groups=[ + datacatalog.EntryGroup(), + ], + next_page_token="ghi", ), datacatalog.ListEntryGroupsResponse( - entry_groups=[datacatalog.EntryGroup(), datacatalog.EntryGroup(),], + entry_groups=[ + datacatalog.EntryGroup(), + datacatalog.EntryGroup(), + ], ), RuntimeError, ) @@ -1809,7 +1996,9 @@ def test_list_entry_groups_pages(): @pytest.mark.asyncio async def test_list_entry_groups_async_pager(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1828,17 +2017,26 @@ async def test_list_entry_groups_async_pager(): next_page_token="abc", ), datacatalog.ListEntryGroupsResponse( - entry_groups=[], next_page_token="def", + entry_groups=[], + next_page_token="def", ), datacatalog.ListEntryGroupsResponse( - entry_groups=[datacatalog.EntryGroup(),], next_page_token="ghi", + entry_groups=[ + datacatalog.EntryGroup(), + ], + next_page_token="ghi", ), datacatalog.ListEntryGroupsResponse( - entry_groups=[datacatalog.EntryGroup(), datacatalog.EntryGroup(),], + entry_groups=[ + datacatalog.EntryGroup(), + datacatalog.EntryGroup(), + ], ), RuntimeError, ) - async_pager = await client.list_entry_groups(request={},) + async_pager = await client.list_entry_groups( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -1850,7 +2048,9 @@ async def test_list_entry_groups_async_pager(): @pytest.mark.asyncio async def test_list_entry_groups_async_pages(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1869,13 +2069,20 @@ async def test_list_entry_groups_async_pages(): next_page_token="abc", ), datacatalog.ListEntryGroupsResponse( - entry_groups=[], next_page_token="def", + entry_groups=[], + next_page_token="def", ), datacatalog.ListEntryGroupsResponse( - entry_groups=[datacatalog.EntryGroup(),], next_page_token="ghi", + entry_groups=[ + datacatalog.EntryGroup(), + ], + next_page_token="ghi", ), datacatalog.ListEntryGroupsResponse( - entry_groups=[datacatalog.EntryGroup(), datacatalog.EntryGroup(),], + entry_groups=[ + datacatalog.EntryGroup(), + datacatalog.EntryGroup(), + ], ), RuntimeError, ) @@ -1890,7 +2097,8 @@ def test_create_entry( transport: str = "grpc", request_type=datacatalog.CreateEntryRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1939,7 +2147,8 @@ def test_create_entry_from_dict(): @pytest.mark.asyncio async def test_create_entry_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1981,7 +2190,9 @@ async def test_create_entry_async(transport: str = "grpc_asyncio"): def test_create_entry_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2001,12 +2212,17 @@ def test_create_entry_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_entry_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2028,11 +2244,16 @@ async def test_create_entry_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_entry_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.create_entry), "__call__") as call: @@ -2060,7 +2281,9 @@ def test_create_entry_flattened(): def test_create_entry_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -2075,7 +2298,9 @@ def test_create_entry_flattened_error(): @pytest.mark.asyncio async def test_create_entry_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2107,7 +2332,9 @@ async def test_create_entry_flattened_async(): @pytest.mark.asyncio async def test_create_entry_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -2124,7 +2351,8 @@ def test_update_entry( transport: str = "grpc", request_type=datacatalog.UpdateEntryRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2173,7 +2401,8 @@ def test_update_entry_from_dict(): @pytest.mark.asyncio async def test_update_entry_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2215,7 +2444,9 @@ async def test_update_entry_async(transport: str = "grpc_asyncio"): def test_update_entry_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2235,12 +2466,17 @@ def test_update_entry_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "entry.name=entry.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "entry.name=entry.name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_update_entry_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2262,11 +2498,16 @@ async def test_update_entry_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "entry.name=entry.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "entry.name=entry.name/value", + ) in kw["metadata"] def test_update_entry_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.update_entry), "__call__") as call: @@ -2291,7 +2532,9 @@ def test_update_entry_flattened(): def test_update_entry_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -2305,7 +2548,9 @@ def test_update_entry_flattened_error(): @pytest.mark.asyncio async def test_update_entry_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2334,7 +2579,9 @@ async def test_update_entry_flattened_async(): @pytest.mark.asyncio async def test_update_entry_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -2350,7 +2597,8 @@ def test_delete_entry( transport: str = "grpc", request_type=datacatalog.DeleteEntryRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2381,7 +2629,8 @@ def test_delete_entry_from_dict(): @pytest.mark.asyncio async def test_delete_entry_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2408,7 +2657,9 @@ async def test_delete_entry_async(transport: str = "grpc_asyncio"): def test_delete_entry_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2428,12 +2679,17 @@ def test_delete_entry_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_entry_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2455,11 +2711,16 @@ async def test_delete_entry_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_entry_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.delete_entry), "__call__") as call: @@ -2468,7 +2729,9 @@ def test_delete_entry_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_entry(name="name_value",) + client.delete_entry( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2479,19 +2742,24 @@ def test_delete_entry_flattened(): def test_delete_entry_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_entry( - datacatalog.DeleteEntryRequest(), name="name_value", + datacatalog.DeleteEntryRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_delete_entry_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2503,7 +2771,9 @@ async def test_delete_entry_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_entry(name="name_value",) + response = await client.delete_entry( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2515,19 +2785,23 @@ async def test_delete_entry_flattened_async(): @pytest.mark.asyncio async def test_delete_entry_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_entry( - datacatalog.DeleteEntryRequest(), name="name_value", + datacatalog.DeleteEntryRequest(), + name="name_value", ) def test_get_entry(transport: str = "grpc", request_type=datacatalog.GetEntryRequest): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2576,7 +2850,8 @@ def test_get_entry_from_dict(): @pytest.mark.asyncio async def test_get_entry_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2618,7 +2893,9 @@ async def test_get_entry_async(transport: str = "grpc_asyncio"): def test_get_entry_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2638,12 +2915,17 @@ def test_get_entry_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_entry_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2665,11 +2947,16 @@ async def test_get_entry_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_entry_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.get_entry), "__call__") as call: @@ -2678,7 +2965,9 @@ def test_get_entry_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_entry(name="name_value",) + client.get_entry( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2689,19 +2978,24 @@ def test_get_entry_flattened(): def test_get_entry_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_entry( - datacatalog.GetEntryRequest(), name="name_value", + datacatalog.GetEntryRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_get_entry_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2713,7 +3007,9 @@ async def test_get_entry_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(datacatalog.Entry()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_entry(name="name_value",) + response = await client.get_entry( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2725,13 +3021,16 @@ async def test_get_entry_flattened_async(): @pytest.mark.asyncio async def test_get_entry_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_entry( - datacatalog.GetEntryRequest(), name="name_value", + datacatalog.GetEntryRequest(), + name="name_value", ) @@ -2739,7 +3038,8 @@ def test_lookup_entry( transport: str = "grpc", request_type=datacatalog.LookupEntryRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2788,7 +3088,8 @@ def test_lookup_entry_from_dict(): @pytest.mark.asyncio async def test_lookup_entry_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2833,7 +3134,8 @@ def test_list_entries( transport: str = "grpc", request_type=datacatalog.ListEntriesRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2868,7 +3170,8 @@ def test_list_entries_from_dict(): @pytest.mark.asyncio async def test_list_entries_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2881,7 +3184,9 @@ async def test_list_entries_async(transport: str = "grpc_asyncio"): ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - datacatalog.ListEntriesResponse(next_page_token="next_page_token_value",) + datacatalog.ListEntriesResponse( + next_page_token="next_page_token_value", + ) ) response = await client.list_entries(request) @@ -2899,7 +3204,9 @@ async def test_list_entries_async(transport: str = "grpc_asyncio"): def test_list_entries_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2919,12 +3226,17 @@ def test_list_entries_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_list_entries_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2948,11 +3260,16 @@ async def test_list_entries_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_entries_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.list_entries), "__call__") as call: @@ -2961,7 +3278,9 @@ def test_list_entries_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_entries(parent="parent_value",) + client.list_entries( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2972,19 +3291,24 @@ def test_list_entries_flattened(): def test_list_entries_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_entries( - datacatalog.ListEntriesRequest(), parent="parent_value", + datacatalog.ListEntriesRequest(), + parent="parent_value", ) @pytest.mark.asyncio async def test_list_entries_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2998,7 +3322,9 @@ async def test_list_entries_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_entries(parent="parent_value",) + response = await client.list_entries( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3010,18 +3336,23 @@ async def test_list_entries_flattened_async(): @pytest.mark.asyncio async def test_list_entries_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.list_entries( - datacatalog.ListEntriesRequest(), parent="parent_value", + datacatalog.ListEntriesRequest(), + parent="parent_value", ) def test_list_entries_pager(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.list_entries), "__call__") as call: @@ -3035,12 +3366,21 @@ def test_list_entries_pager(): ], next_page_token="abc", ), - datacatalog.ListEntriesResponse(entries=[], next_page_token="def",), datacatalog.ListEntriesResponse( - entries=[datacatalog.Entry(),], next_page_token="ghi", + entries=[], + next_page_token="def", ), datacatalog.ListEntriesResponse( - entries=[datacatalog.Entry(), datacatalog.Entry(),], + entries=[ + datacatalog.Entry(), + ], + next_page_token="ghi", + ), + datacatalog.ListEntriesResponse( + entries=[ + datacatalog.Entry(), + datacatalog.Entry(), + ], ), RuntimeError, ) @@ -3059,7 +3399,9 @@ def test_list_entries_pager(): def test_list_entries_pages(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.list_entries), "__call__") as call: @@ -3073,12 +3415,21 @@ def test_list_entries_pages(): ], next_page_token="abc", ), - datacatalog.ListEntriesResponse(entries=[], next_page_token="def",), datacatalog.ListEntriesResponse( - entries=[datacatalog.Entry(),], next_page_token="ghi", + entries=[], + next_page_token="def", ), datacatalog.ListEntriesResponse( - entries=[datacatalog.Entry(), datacatalog.Entry(),], + entries=[ + datacatalog.Entry(), + ], + next_page_token="ghi", + ), + datacatalog.ListEntriesResponse( + entries=[ + datacatalog.Entry(), + datacatalog.Entry(), + ], ), RuntimeError, ) @@ -3089,7 +3440,9 @@ def test_list_entries_pages(): @pytest.mark.asyncio async def test_list_entries_async_pager(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3107,16 +3460,27 @@ async def test_list_entries_async_pager(): ], next_page_token="abc", ), - datacatalog.ListEntriesResponse(entries=[], next_page_token="def",), datacatalog.ListEntriesResponse( - entries=[datacatalog.Entry(),], next_page_token="ghi", + entries=[], + next_page_token="def", ), datacatalog.ListEntriesResponse( - entries=[datacatalog.Entry(), datacatalog.Entry(),], + entries=[ + datacatalog.Entry(), + ], + next_page_token="ghi", + ), + datacatalog.ListEntriesResponse( + entries=[ + datacatalog.Entry(), + datacatalog.Entry(), + ], ), RuntimeError, ) - async_pager = await client.list_entries(request={},) + async_pager = await client.list_entries( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -3128,7 +3492,9 @@ async def test_list_entries_async_pager(): @pytest.mark.asyncio async def test_list_entries_async_pages(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3146,12 +3512,21 @@ async def test_list_entries_async_pages(): ], next_page_token="abc", ), - datacatalog.ListEntriesResponse(entries=[], next_page_token="def",), datacatalog.ListEntriesResponse( - entries=[datacatalog.Entry(),], next_page_token="ghi", + entries=[], + next_page_token="def", ), datacatalog.ListEntriesResponse( - entries=[datacatalog.Entry(), datacatalog.Entry(),], + entries=[ + datacatalog.Entry(), + ], + next_page_token="ghi", + ), + datacatalog.ListEntriesResponse( + entries=[ + datacatalog.Entry(), + datacatalog.Entry(), + ], ), RuntimeError, ) @@ -3166,7 +3541,8 @@ def test_create_tag_template( transport: str = "grpc", request_type=datacatalog.CreateTagTemplateRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3179,7 +3555,8 @@ def test_create_tag_template( ) as call: # Designate an appropriate return value for the call. call.return_value = tags.TagTemplate( - name="name_value", display_name="display_name_value", + name="name_value", + display_name="display_name_value", ) response = client.create_tag_template(request) @@ -3205,7 +3582,8 @@ def test_create_tag_template_from_dict(): @pytest.mark.asyncio async def test_create_tag_template_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3218,7 +3596,10 @@ async def test_create_tag_template_async(transport: str = "grpc_asyncio"): ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - tags.TagTemplate(name="name_value", display_name="display_name_value",) + tags.TagTemplate( + name="name_value", + display_name="display_name_value", + ) ) response = await client.create_tag_template(request) @@ -3238,7 +3619,9 @@ async def test_create_tag_template_async(transport: str = "grpc_asyncio"): def test_create_tag_template_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3260,12 +3643,17 @@ def test_create_tag_template_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_tag_template_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3287,11 +3675,16 @@ async def test_create_tag_template_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_tag_template_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3321,7 +3714,9 @@ def test_create_tag_template_flattened(): def test_create_tag_template_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -3336,7 +3731,9 @@ def test_create_tag_template_flattened_error(): @pytest.mark.asyncio async def test_create_tag_template_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3368,7 +3765,9 @@ async def test_create_tag_template_flattened_async(): @pytest.mark.asyncio async def test_create_tag_template_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -3385,7 +3784,8 @@ def test_get_tag_template( transport: str = "grpc", request_type=datacatalog.GetTagTemplateRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3398,7 +3798,8 @@ def test_get_tag_template( ) as call: # Designate an appropriate return value for the call. call.return_value = tags.TagTemplate( - name="name_value", display_name="display_name_value", + name="name_value", + display_name="display_name_value", ) response = client.get_tag_template(request) @@ -3424,7 +3825,8 @@ def test_get_tag_template_from_dict(): @pytest.mark.asyncio async def test_get_tag_template_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3437,7 +3839,10 @@ async def test_get_tag_template_async(transport: str = "grpc_asyncio"): ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - tags.TagTemplate(name="name_value", display_name="display_name_value",) + tags.TagTemplate( + name="name_value", + display_name="display_name_value", + ) ) response = await client.get_tag_template(request) @@ -3457,7 +3862,9 @@ async def test_get_tag_template_async(transport: str = "grpc_asyncio"): def test_get_tag_template_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3479,12 +3886,17 @@ def test_get_tag_template_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_tag_template_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3506,11 +3918,16 @@ async def test_get_tag_template_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_tag_template_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3521,7 +3938,9 @@ def test_get_tag_template_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_tag_template(name="name_value",) + client.get_tag_template( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3532,19 +3951,24 @@ def test_get_tag_template_flattened(): def test_get_tag_template_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_tag_template( - datacatalog.GetTagTemplateRequest(), name="name_value", + datacatalog.GetTagTemplateRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_get_tag_template_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3556,7 +3980,9 @@ async def test_get_tag_template_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(tags.TagTemplate()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_tag_template(name="name_value",) + response = await client.get_tag_template( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3568,13 +3994,16 @@ async def test_get_tag_template_flattened_async(): @pytest.mark.asyncio async def test_get_tag_template_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_tag_template( - datacatalog.GetTagTemplateRequest(), name="name_value", + datacatalog.GetTagTemplateRequest(), + name="name_value", ) @@ -3582,7 +4011,8 @@ def test_update_tag_template( transport: str = "grpc", request_type=datacatalog.UpdateTagTemplateRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3595,7 +4025,8 @@ def test_update_tag_template( ) as call: # Designate an appropriate return value for the call. call.return_value = tags.TagTemplate( - name="name_value", display_name="display_name_value", + name="name_value", + display_name="display_name_value", ) response = client.update_tag_template(request) @@ -3621,7 +4052,8 @@ def test_update_tag_template_from_dict(): @pytest.mark.asyncio async def test_update_tag_template_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3634,7 +4066,10 @@ async def test_update_tag_template_async(transport: str = "grpc_asyncio"): ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - tags.TagTemplate(name="name_value", display_name="display_name_value",) + tags.TagTemplate( + name="name_value", + display_name="display_name_value", + ) ) response = await client.update_tag_template(request) @@ -3654,7 +4089,9 @@ async def test_update_tag_template_async(transport: str = "grpc_asyncio"): def test_update_tag_template_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3684,7 +4121,9 @@ def test_update_tag_template_field_headers(): @pytest.mark.asyncio async def test_update_tag_template_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3713,7 +4152,9 @@ async def test_update_tag_template_field_headers_async(): def test_update_tag_template_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3740,7 +4181,9 @@ def test_update_tag_template_flattened(): def test_update_tag_template_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -3754,7 +4197,9 @@ def test_update_tag_template_flattened_error(): @pytest.mark.asyncio async def test_update_tag_template_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3783,7 +4228,9 @@ async def test_update_tag_template_flattened_async(): @pytest.mark.asyncio async def test_update_tag_template_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -3799,7 +4246,8 @@ def test_delete_tag_template( transport: str = "grpc", request_type=datacatalog.DeleteTagTemplateRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3832,7 +4280,8 @@ def test_delete_tag_template_from_dict(): @pytest.mark.asyncio async def test_delete_tag_template_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3859,7 +4308,9 @@ async def test_delete_tag_template_async(transport: str = "grpc_asyncio"): def test_delete_tag_template_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3881,12 +4332,17 @@ def test_delete_tag_template_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_tag_template_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3908,11 +4364,16 @@ async def test_delete_tag_template_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_tag_template_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3924,7 +4385,8 @@ def test_delete_tag_template_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.delete_tag_template( - name="name_value", force=True, + name="name_value", + force=True, ) # Establish that the underlying call was made with the expected @@ -3938,19 +4400,25 @@ def test_delete_tag_template_flattened(): def test_delete_tag_template_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_tag_template( - datacatalog.DeleteTagTemplateRequest(), name="name_value", force=True, + datacatalog.DeleteTagTemplateRequest(), + name="name_value", + force=True, ) @pytest.mark.asyncio async def test_delete_tag_template_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3962,7 +4430,10 @@ async def test_delete_tag_template_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_tag_template(name="name_value", force=True,) + response = await client.delete_tag_template( + name="name_value", + force=True, + ) # Establish that the underlying call was made with the expected # request object values. @@ -3976,13 +4447,17 @@ async def test_delete_tag_template_flattened_async(): @pytest.mark.asyncio async def test_delete_tag_template_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_tag_template( - datacatalog.DeleteTagTemplateRequest(), name="name_value", force=True, + datacatalog.DeleteTagTemplateRequest(), + name="name_value", + force=True, ) @@ -3990,7 +4465,8 @@ def test_create_tag_template_field( transport: str = "grpc", request_type=datacatalog.CreateTagTemplateFieldRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4036,7 +4512,8 @@ def test_create_tag_template_field_from_dict(): @pytest.mark.asyncio async def test_create_tag_template_field_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4078,7 +4555,9 @@ async def test_create_tag_template_field_async(transport: str = "grpc_asyncio"): def test_create_tag_template_field_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4100,12 +4579,17 @@ def test_create_tag_template_field_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_tag_template_field_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4129,11 +4613,16 @@ async def test_create_tag_template_field_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_tag_template_field_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4163,7 +4652,9 @@ def test_create_tag_template_field_flattened(): def test_create_tag_template_field_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4178,7 +4669,9 @@ def test_create_tag_template_field_flattened_error(): @pytest.mark.asyncio async def test_create_tag_template_field_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4212,7 +4705,9 @@ async def test_create_tag_template_field_flattened_async(): @pytest.mark.asyncio async def test_create_tag_template_field_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4229,7 +4724,8 @@ def test_update_tag_template_field( transport: str = "grpc", request_type=datacatalog.UpdateTagTemplateFieldRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4275,7 +4771,8 @@ def test_update_tag_template_field_from_dict(): @pytest.mark.asyncio async def test_update_tag_template_field_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4317,7 +4814,9 @@ async def test_update_tag_template_field_async(transport: str = "grpc_asyncio"): def test_update_tag_template_field_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4339,12 +4838,17 @@ def test_update_tag_template_field_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_update_tag_template_field_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4368,11 +4872,16 @@ async def test_update_tag_template_field_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_update_tag_template_field_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4402,7 +4911,9 @@ def test_update_tag_template_field_flattened(): def test_update_tag_template_field_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4417,7 +4928,9 @@ def test_update_tag_template_field_flattened_error(): @pytest.mark.asyncio async def test_update_tag_template_field_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4451,7 +4964,9 @@ async def test_update_tag_template_field_flattened_async(): @pytest.mark.asyncio async def test_update_tag_template_field_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4468,7 +4983,8 @@ def test_rename_tag_template_field( transport: str = "grpc", request_type=datacatalog.RenameTagTemplateFieldRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4514,7 +5030,8 @@ def test_rename_tag_template_field_from_dict(): @pytest.mark.asyncio async def test_rename_tag_template_field_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4556,7 +5073,9 @@ async def test_rename_tag_template_field_async(transport: str = "grpc_asyncio"): def test_rename_tag_template_field_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4578,12 +5097,17 @@ def test_rename_tag_template_field_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_rename_tag_template_field_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4607,11 +5131,16 @@ async def test_rename_tag_template_field_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_rename_tag_template_field_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4638,7 +5167,9 @@ def test_rename_tag_template_field_flattened(): def test_rename_tag_template_field_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4652,7 +5183,9 @@ def test_rename_tag_template_field_flattened_error(): @pytest.mark.asyncio async def test_rename_tag_template_field_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4683,7 +5216,9 @@ async def test_rename_tag_template_field_flattened_async(): @pytest.mark.asyncio async def test_rename_tag_template_field_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4699,7 +5234,8 @@ def test_delete_tag_template_field( transport: str = "grpc", request_type=datacatalog.DeleteTagTemplateFieldRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4732,7 +5268,8 @@ def test_delete_tag_template_field_from_dict(): @pytest.mark.asyncio async def test_delete_tag_template_field_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4759,7 +5296,9 @@ async def test_delete_tag_template_field_async(transport: str = "grpc_asyncio"): def test_delete_tag_template_field_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4781,12 +5320,17 @@ def test_delete_tag_template_field_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_tag_template_field_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4808,11 +5352,16 @@ async def test_delete_tag_template_field_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_tag_template_field_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4824,7 +5373,8 @@ def test_delete_tag_template_field_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.delete_tag_template_field( - name="name_value", force=True, + name="name_value", + force=True, ) # Establish that the underlying call was made with the expected @@ -4838,19 +5388,25 @@ def test_delete_tag_template_field_flattened(): def test_delete_tag_template_field_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_tag_template_field( - datacatalog.DeleteTagTemplateFieldRequest(), name="name_value", force=True, + datacatalog.DeleteTagTemplateFieldRequest(), + name="name_value", + force=True, ) @pytest.mark.asyncio async def test_delete_tag_template_field_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4863,7 +5419,8 @@ async def test_delete_tag_template_field_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.delete_tag_template_field( - name="name_value", force=True, + name="name_value", + force=True, ) # Establish that the underlying call was made with the expected @@ -4878,19 +5435,24 @@ async def test_delete_tag_template_field_flattened_async(): @pytest.mark.asyncio async def test_delete_tag_template_field_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_tag_template_field( - datacatalog.DeleteTagTemplateFieldRequest(), name="name_value", force=True, + datacatalog.DeleteTagTemplateFieldRequest(), + name="name_value", + force=True, ) def test_create_tag(transport: str = "grpc", request_type=datacatalog.CreateTagRequest): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4932,7 +5494,8 @@ def test_create_tag_from_dict(): @pytest.mark.asyncio async def test_create_tag_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4971,7 +5534,9 @@ async def test_create_tag_async(transport: str = "grpc_asyncio"): def test_create_tag_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4991,12 +5556,17 @@ def test_create_tag_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_tag_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5018,11 +5588,16 @@ async def test_create_tag_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_tag_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.create_tag), "__call__") as call: @@ -5032,7 +5607,8 @@ def test_create_tag_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.create_tag( - parent="parent_value", tag=tags.Tag(name="name_value"), + parent="parent_value", + tag=tags.Tag(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -5046,7 +5622,9 @@ def test_create_tag_flattened(): def test_create_tag_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -5060,7 +5638,9 @@ def test_create_tag_flattened_error(): @pytest.mark.asyncio async def test_create_tag_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5073,7 +5653,8 @@ async def test_create_tag_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.create_tag( - parent="parent_value", tag=tags.Tag(name="name_value"), + parent="parent_value", + tag=tags.Tag(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -5088,7 +5669,9 @@ async def test_create_tag_flattened_async(): @pytest.mark.asyncio async def test_create_tag_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -5102,7 +5685,8 @@ async def test_create_tag_flattened_error_async(): def test_update_tag(transport: str = "grpc", request_type=datacatalog.UpdateTagRequest): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5144,7 +5728,8 @@ def test_update_tag_from_dict(): @pytest.mark.asyncio async def test_update_tag_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5183,7 +5768,9 @@ async def test_update_tag_async(transport: str = "grpc_asyncio"): def test_update_tag_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5203,12 +5790,17 @@ def test_update_tag_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "tag.name=tag.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "tag.name=tag.name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_update_tag_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5230,11 +5822,16 @@ async def test_update_tag_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "tag.name=tag.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "tag.name=tag.name/value", + ) in kw["metadata"] def test_update_tag_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.update_tag), "__call__") as call: @@ -5259,7 +5856,9 @@ def test_update_tag_flattened(): def test_update_tag_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -5273,7 +5872,9 @@ def test_update_tag_flattened_error(): @pytest.mark.asyncio async def test_update_tag_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5302,7 +5903,9 @@ async def test_update_tag_flattened_async(): @pytest.mark.asyncio async def test_update_tag_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -5316,7 +5919,8 @@ async def test_update_tag_flattened_error_async(): def test_delete_tag(transport: str = "grpc", request_type=datacatalog.DeleteTagRequest): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5347,7 +5951,8 @@ def test_delete_tag_from_dict(): @pytest.mark.asyncio async def test_delete_tag_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5374,7 +5979,9 @@ async def test_delete_tag_async(transport: str = "grpc_asyncio"): def test_delete_tag_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5394,12 +6001,17 @@ def test_delete_tag_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_tag_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5421,11 +6033,16 @@ async def test_delete_tag_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_tag_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.delete_tag), "__call__") as call: @@ -5434,7 +6051,9 @@ def test_delete_tag_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_tag(name="name_value",) + client.delete_tag( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5445,19 +6064,24 @@ def test_delete_tag_flattened(): def test_delete_tag_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_tag( - datacatalog.DeleteTagRequest(), name="name_value", + datacatalog.DeleteTagRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_delete_tag_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5469,7 +6093,9 @@ async def test_delete_tag_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_tag(name="name_value",) + response = await client.delete_tag( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5481,19 +6107,23 @@ async def test_delete_tag_flattened_async(): @pytest.mark.asyncio async def test_delete_tag_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_tag( - datacatalog.DeleteTagRequest(), name="name_value", + datacatalog.DeleteTagRequest(), + name="name_value", ) def test_list_tags(transport: str = "grpc", request_type=datacatalog.ListTagsRequest): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5528,7 +6158,8 @@ def test_list_tags_from_dict(): @pytest.mark.asyncio async def test_list_tags_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5541,7 +6172,9 @@ async def test_list_tags_async(transport: str = "grpc_asyncio"): ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - datacatalog.ListTagsResponse(next_page_token="next_page_token_value",) + datacatalog.ListTagsResponse( + next_page_token="next_page_token_value", + ) ) response = await client.list_tags(request) @@ -5559,7 +6192,9 @@ async def test_list_tags_async(transport: str = "grpc_asyncio"): def test_list_tags_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5579,12 +6214,17 @@ def test_list_tags_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_list_tags_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5608,11 +6248,16 @@ async def test_list_tags_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_tags_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.list_tags), "__call__") as call: @@ -5621,7 +6266,9 @@ def test_list_tags_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_tags(parent="parent_value",) + client.list_tags( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5632,19 +6279,24 @@ def test_list_tags_flattened(): def test_list_tags_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_tags( - datacatalog.ListTagsRequest(), parent="parent_value", + datacatalog.ListTagsRequest(), + parent="parent_value", ) @pytest.mark.asyncio async def test_list_tags_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5658,7 +6310,9 @@ async def test_list_tags_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_tags(parent="parent_value",) + response = await client.list_tags( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5670,29 +6324,52 @@ async def test_list_tags_flattened_async(): @pytest.mark.asyncio async def test_list_tags_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.list_tags( - datacatalog.ListTagsRequest(), parent="parent_value", + datacatalog.ListTagsRequest(), + parent="parent_value", ) def test_list_tags_pager(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.list_tags), "__call__") as call: # Set the response to a series of pages. call.side_effect = ( datacatalog.ListTagsResponse( - tags=[tags.Tag(), tags.Tag(), tags.Tag(),], next_page_token="abc", + tags=[ + tags.Tag(), + tags.Tag(), + tags.Tag(), + ], + next_page_token="abc", + ), + datacatalog.ListTagsResponse( + tags=[], + next_page_token="def", + ), + datacatalog.ListTagsResponse( + tags=[ + tags.Tag(), + ], + next_page_token="ghi", + ), + datacatalog.ListTagsResponse( + tags=[ + tags.Tag(), + tags.Tag(), + ], ), - datacatalog.ListTagsResponse(tags=[], next_page_token="def",), - datacatalog.ListTagsResponse(tags=[tags.Tag(),], next_page_token="ghi",), - datacatalog.ListTagsResponse(tags=[tags.Tag(), tags.Tag(),],), RuntimeError, ) @@ -5710,18 +6387,38 @@ def test_list_tags_pager(): def test_list_tags_pages(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.list_tags), "__call__") as call: # Set the response to a series of pages. call.side_effect = ( datacatalog.ListTagsResponse( - tags=[tags.Tag(), tags.Tag(), tags.Tag(),], next_page_token="abc", + tags=[ + tags.Tag(), + tags.Tag(), + tags.Tag(), + ], + next_page_token="abc", + ), + datacatalog.ListTagsResponse( + tags=[], + next_page_token="def", + ), + datacatalog.ListTagsResponse( + tags=[ + tags.Tag(), + ], + next_page_token="ghi", + ), + datacatalog.ListTagsResponse( + tags=[ + tags.Tag(), + tags.Tag(), + ], ), - datacatalog.ListTagsResponse(tags=[], next_page_token="def",), - datacatalog.ListTagsResponse(tags=[tags.Tag(),], next_page_token="ghi",), - datacatalog.ListTagsResponse(tags=[tags.Tag(), tags.Tag(),],), RuntimeError, ) pages = list(client.list_tags(request={}).pages) @@ -5731,7 +6428,9 @@ def test_list_tags_pages(): @pytest.mark.asyncio async def test_list_tags_async_pager(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5742,14 +6441,34 @@ async def test_list_tags_async_pager(): # Set the response to a series of pages. call.side_effect = ( datacatalog.ListTagsResponse( - tags=[tags.Tag(), tags.Tag(), tags.Tag(),], next_page_token="abc", + tags=[ + tags.Tag(), + tags.Tag(), + tags.Tag(), + ], + next_page_token="abc", + ), + datacatalog.ListTagsResponse( + tags=[], + next_page_token="def", + ), + datacatalog.ListTagsResponse( + tags=[ + tags.Tag(), + ], + next_page_token="ghi", + ), + datacatalog.ListTagsResponse( + tags=[ + tags.Tag(), + tags.Tag(), + ], ), - datacatalog.ListTagsResponse(tags=[], next_page_token="def",), - datacatalog.ListTagsResponse(tags=[tags.Tag(),], next_page_token="ghi",), - datacatalog.ListTagsResponse(tags=[tags.Tag(), tags.Tag(),],), RuntimeError, ) - async_pager = await client.list_tags(request={},) + async_pager = await client.list_tags( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -5761,7 +6480,9 @@ async def test_list_tags_async_pager(): @pytest.mark.asyncio async def test_list_tags_async_pages(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5772,11 +6493,29 @@ async def test_list_tags_async_pages(): # Set the response to a series of pages. call.side_effect = ( datacatalog.ListTagsResponse( - tags=[tags.Tag(), tags.Tag(), tags.Tag(),], next_page_token="abc", + tags=[ + tags.Tag(), + tags.Tag(), + tags.Tag(), + ], + next_page_token="abc", + ), + datacatalog.ListTagsResponse( + tags=[], + next_page_token="def", + ), + datacatalog.ListTagsResponse( + tags=[ + tags.Tag(), + ], + next_page_token="ghi", + ), + datacatalog.ListTagsResponse( + tags=[ + tags.Tag(), + tags.Tag(), + ], ), - datacatalog.ListTagsResponse(tags=[], next_page_token="def",), - datacatalog.ListTagsResponse(tags=[tags.Tag(),], next_page_token="ghi",), - datacatalog.ListTagsResponse(tags=[tags.Tag(), tags.Tag(),],), RuntimeError, ) pages = [] @@ -5790,7 +6529,8 @@ def test_set_iam_policy( transport: str = "grpc", request_type=iam_policy.SetIamPolicyRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5800,7 +6540,10 @@ def test_set_iam_policy( # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.set_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. - call.return_value = policy.Policy(version=774, etag=b"etag_blob",) + call.return_value = policy.Policy( + version=774, + etag=b"etag_blob", + ) response = client.set_iam_policy(request) @@ -5825,7 +6568,8 @@ def test_set_iam_policy_from_dict(): @pytest.mark.asyncio async def test_set_iam_policy_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5838,7 +6582,10 @@ async def test_set_iam_policy_async(transport: str = "grpc_asyncio"): ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - policy.Policy(version=774, etag=b"etag_blob",) + policy.Policy( + version=774, + etag=b"etag_blob", + ) ) response = await client.set_iam_policy(request) @@ -5858,7 +6605,9 @@ async def test_set_iam_policy_async(transport: str = "grpc_asyncio"): def test_set_iam_policy_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5878,12 +6627,17 @@ def test_set_iam_policy_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_set_iam_policy_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5905,11 +6659,16 @@ async def test_set_iam_policy_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] def test_set_iam_policy_from_dict(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.set_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. @@ -5925,7 +6684,9 @@ def test_set_iam_policy_from_dict(): def test_set_iam_policy_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.set_iam_policy), "__call__") as call: @@ -5934,7 +6695,9 @@ def test_set_iam_policy_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.set_iam_policy(resource="resource_value",) + client.set_iam_policy( + resource="resource_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5945,19 +6708,24 @@ def test_set_iam_policy_flattened(): def test_set_iam_policy_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.set_iam_policy( - iam_policy.SetIamPolicyRequest(), resource="resource_value", + iam_policy.SetIamPolicyRequest(), + resource="resource_value", ) @pytest.mark.asyncio async def test_set_iam_policy_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5969,7 +6737,9 @@ async def test_set_iam_policy_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(policy.Policy()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.set_iam_policy(resource="resource_value",) + response = await client.set_iam_policy( + resource="resource_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5981,13 +6751,16 @@ async def test_set_iam_policy_flattened_async(): @pytest.mark.asyncio async def test_set_iam_policy_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.set_iam_policy( - iam_policy.SetIamPolicyRequest(), resource="resource_value", + iam_policy.SetIamPolicyRequest(), + resource="resource_value", ) @@ -5995,7 +6768,8 @@ def test_get_iam_policy( transport: str = "grpc", request_type=iam_policy.GetIamPolicyRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -6005,7 +6779,10 @@ def test_get_iam_policy( # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.get_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. - call.return_value = policy.Policy(version=774, etag=b"etag_blob",) + call.return_value = policy.Policy( + version=774, + etag=b"etag_blob", + ) response = client.get_iam_policy(request) @@ -6030,7 +6807,8 @@ def test_get_iam_policy_from_dict(): @pytest.mark.asyncio async def test_get_iam_policy_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -6043,7 +6821,10 @@ async def test_get_iam_policy_async(transport: str = "grpc_asyncio"): ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - policy.Policy(version=774, etag=b"etag_blob",) + policy.Policy( + version=774, + etag=b"etag_blob", + ) ) response = await client.get_iam_policy(request) @@ -6063,7 +6844,9 @@ async def test_get_iam_policy_async(transport: str = "grpc_asyncio"): def test_get_iam_policy_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -6083,12 +6866,17 @@ def test_get_iam_policy_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_iam_policy_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -6110,11 +6898,16 @@ async def test_get_iam_policy_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] def test_get_iam_policy_from_dict(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.get_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. @@ -6130,7 +6923,9 @@ def test_get_iam_policy_from_dict(): def test_get_iam_policy_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.get_iam_policy), "__call__") as call: @@ -6139,7 +6934,9 @@ def test_get_iam_policy_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_iam_policy(resource="resource_value",) + client.get_iam_policy( + resource="resource_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -6150,19 +6947,24 @@ def test_get_iam_policy_flattened(): def test_get_iam_policy_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_iam_policy( - iam_policy.GetIamPolicyRequest(), resource="resource_value", + iam_policy.GetIamPolicyRequest(), + resource="resource_value", ) @pytest.mark.asyncio async def test_get_iam_policy_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6174,7 +6976,9 @@ async def test_get_iam_policy_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(policy.Policy()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_iam_policy(resource="resource_value",) + response = await client.get_iam_policy( + resource="resource_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -6186,13 +6990,16 @@ async def test_get_iam_policy_flattened_async(): @pytest.mark.asyncio async def test_get_iam_policy_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_iam_policy( - iam_policy.GetIamPolicyRequest(), resource="resource_value", + iam_policy.GetIamPolicyRequest(), + resource="resource_value", ) @@ -6200,7 +7007,8 @@ def test_test_iam_permissions( transport: str = "grpc", request_type=iam_policy.TestIamPermissionsRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -6237,7 +7045,8 @@ def test_test_iam_permissions_from_dict(): @pytest.mark.asyncio async def test_test_iam_permissions_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -6250,7 +7059,9 @@ async def test_test_iam_permissions_async(transport: str = "grpc_asyncio"): ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - iam_policy.TestIamPermissionsResponse(permissions=["permissions_value"],) + iam_policy.TestIamPermissionsResponse( + permissions=["permissions_value"], + ) ) response = await client.test_iam_permissions(request) @@ -6268,7 +7079,9 @@ async def test_test_iam_permissions_async(transport: str = "grpc_asyncio"): def test_test_iam_permissions_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -6290,12 +7103,17 @@ def test_test_iam_permissions_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_test_iam_permissions_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -6319,11 +7137,16 @@ async def test_test_iam_permissions_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] def test_test_iam_permissions_from_dict(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client._transport.test_iam_permissions), "__call__" @@ -6347,7 +7170,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # It is an error to provide a credentials file and a transport instance. @@ -6366,7 +7190,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = DataCatalogClient( - client_options={"scopes": ["1", "2"]}, transport=transport, + client_options={"scopes": ["1", "2"]}, + transport=transport, ) @@ -6396,8 +7221,13 @@ def test_transport_get_channel(): def test_transport_grpc_default(): # A client should use the gRPC transport by default. - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) - assert isinstance(client._transport, transports.DataCatalogGrpcTransport,) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) + assert isinstance( + client._transport, + transports.DataCatalogGrpcTransport, + ) def test_data_catalog_base_transport_error(): @@ -6465,7 +7295,8 @@ def test_data_catalog_base_transport_with_credentials_file(): Transport.return_value = None load_creds.return_value = (credentials.AnonymousCredentials(), None) transport = transports.DataCatalogTransport( - credentials_file="credentials.json", quota_project_id="octopus", + credentials_file="credentials.json", + quota_project_id="octopus", ) load_creds.assert_called_once_with( "credentials.json", @@ -6704,7 +7535,10 @@ def test_tag_template_field_path(): field = "octopus" expected = "projects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{field}".format( - project=project, location=location, tag_template=tag_template, field=field, + project=project, + location=location, + tag_template=tag_template, + field=field, ) actual = DataCatalogClient.tag_template_field_path( project, location, tag_template, field @@ -6731,8 +7565,12 @@ def test_tag_template_path(): location = "clam" tag_template = "whelk" - expected = "projects/{project}/locations/{location}/tagTemplates/{tag_template}".format( - project=project, location=location, tag_template=tag_template, + expected = ( + "projects/{project}/locations/{location}/tagTemplates/{tag_template}".format( + project=project, + location=location, + tag_template=tag_template, + ) ) actual = DataCatalogClient.tag_template_path(project, location, tag_template) assert expected == actual @@ -6758,7 +7596,10 @@ def test_entry_path(): entry = "octopus" expected = "projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}".format( - project=project, location=location, entry_group=entry_group, entry=entry, + project=project, + location=location, + entry_group=entry_group, + entry=entry, ) actual = DataCatalogClient.entry_path(project, location, entry_group, entry) assert expected == actual @@ -6816,8 +7657,12 @@ def test_entry_group_path(): location = "clam" entry_group = "whelk" - expected = "projects/{project}/locations/{location}/entryGroups/{entry_group}".format( - project=project, location=location, entry_group=entry_group, + expected = ( + "projects/{project}/locations/{location}/entryGroups/{entry_group}".format( + project=project, + location=location, + entry_group=entry_group, + ) ) actual = DataCatalogClient.entry_group_path(project, location, entry_group) assert expected == actual diff --git a/tests/unit/gapic/datacatalog_v1beta1/test_data_catalog.py b/tests/unit/gapic/datacatalog_v1beta1/test_data_catalog.py index 427f8b6b..4f61f538 100644 --- a/tests/unit/gapic/datacatalog_v1beta1/test_data_catalog.py +++ b/tests/unit/gapic/datacatalog_v1beta1/test_data_catalog.py @@ -301,7 +301,9 @@ def test_data_catalog_client_client_options_scopes( client_class, transport_class, transport_name ): # Check the case scopes are provided. - options = client_options.ClientOptions(scopes=["1", "2"],) + options = client_options.ClientOptions( + scopes=["1", "2"], + ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options) @@ -367,7 +369,8 @@ def test_search_catalog( transport: str = "grpc", request_type=datacatalog.SearchCatalogRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -402,7 +405,8 @@ def test_search_catalog_from_dict(): @pytest.mark.asyncio async def test_search_catalog_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -415,7 +419,9 @@ async def test_search_catalog_async(transport: str = "grpc_asyncio"): ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - datacatalog.SearchCatalogResponse(next_page_token="next_page_token_value",) + datacatalog.SearchCatalogResponse( + next_page_token="next_page_token_value", + ) ) response = await client.search_catalog(request) @@ -433,7 +439,9 @@ async def test_search_catalog_async(transport: str = "grpc_asyncio"): def test_search_catalog_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.search_catalog), "__call__") as call: @@ -462,7 +470,9 @@ def test_search_catalog_flattened(): def test_search_catalog_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -478,7 +488,9 @@ def test_search_catalog_flattened_error(): @pytest.mark.asyncio async def test_search_catalog_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -513,7 +525,9 @@ async def test_search_catalog_flattened_async(): @pytest.mark.asyncio async def test_search_catalog_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -528,7 +542,9 @@ async def test_search_catalog_flattened_error_async(): def test_search_catalog_pager(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.search_catalog), "__call__") as call: @@ -542,12 +558,21 @@ def test_search_catalog_pager(): ], next_page_token="abc", ), - datacatalog.SearchCatalogResponse(results=[], next_page_token="def",), datacatalog.SearchCatalogResponse( - results=[search.SearchCatalogResult(),], next_page_token="ghi", + results=[], + next_page_token="def", + ), + datacatalog.SearchCatalogResponse( + results=[ + search.SearchCatalogResult(), + ], + next_page_token="ghi", ), datacatalog.SearchCatalogResponse( - results=[search.SearchCatalogResult(), search.SearchCatalogResult(),], + results=[ + search.SearchCatalogResult(), + search.SearchCatalogResult(), + ], ), RuntimeError, ) @@ -563,7 +588,9 @@ def test_search_catalog_pager(): def test_search_catalog_pages(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.search_catalog), "__call__") as call: @@ -577,12 +604,21 @@ def test_search_catalog_pages(): ], next_page_token="abc", ), - datacatalog.SearchCatalogResponse(results=[], next_page_token="def",), datacatalog.SearchCatalogResponse( - results=[search.SearchCatalogResult(),], next_page_token="ghi", + results=[], + next_page_token="def", + ), + datacatalog.SearchCatalogResponse( + results=[ + search.SearchCatalogResult(), + ], + next_page_token="ghi", ), datacatalog.SearchCatalogResponse( - results=[search.SearchCatalogResult(), search.SearchCatalogResult(),], + results=[ + search.SearchCatalogResult(), + search.SearchCatalogResult(), + ], ), RuntimeError, ) @@ -593,7 +629,9 @@ def test_search_catalog_pages(): @pytest.mark.asyncio async def test_search_catalog_async_pager(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -611,16 +649,27 @@ async def test_search_catalog_async_pager(): ], next_page_token="abc", ), - datacatalog.SearchCatalogResponse(results=[], next_page_token="def",), datacatalog.SearchCatalogResponse( - results=[search.SearchCatalogResult(),], next_page_token="ghi", + results=[], + next_page_token="def", ), datacatalog.SearchCatalogResponse( - results=[search.SearchCatalogResult(), search.SearchCatalogResult(),], + results=[ + search.SearchCatalogResult(), + ], + next_page_token="ghi", + ), + datacatalog.SearchCatalogResponse( + results=[ + search.SearchCatalogResult(), + search.SearchCatalogResult(), + ], ), RuntimeError, ) - async_pager = await client.search_catalog(request={},) + async_pager = await client.search_catalog( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -632,7 +681,9 @@ async def test_search_catalog_async_pager(): @pytest.mark.asyncio async def test_search_catalog_async_pages(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -650,12 +701,21 @@ async def test_search_catalog_async_pages(): ], next_page_token="abc", ), - datacatalog.SearchCatalogResponse(results=[], next_page_token="def",), datacatalog.SearchCatalogResponse( - results=[search.SearchCatalogResult(),], next_page_token="ghi", + results=[], + next_page_token="def", + ), + datacatalog.SearchCatalogResponse( + results=[ + search.SearchCatalogResult(), + ], + next_page_token="ghi", ), datacatalog.SearchCatalogResponse( - results=[search.SearchCatalogResult(), search.SearchCatalogResult(),], + results=[ + search.SearchCatalogResult(), + search.SearchCatalogResult(), + ], ), RuntimeError, ) @@ -670,7 +730,8 @@ def test_create_entry_group( transport: str = "grpc", request_type=datacatalog.CreateEntryGroupRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -713,7 +774,8 @@ def test_create_entry_group_from_dict(): @pytest.mark.asyncio async def test_create_entry_group_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -752,7 +814,9 @@ async def test_create_entry_group_async(transport: str = "grpc_asyncio"): def test_create_entry_group_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -774,12 +838,17 @@ def test_create_entry_group_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_entry_group_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -803,11 +872,16 @@ async def test_create_entry_group_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_entry_group_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -837,7 +911,9 @@ def test_create_entry_group_flattened(): def test_create_entry_group_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -852,7 +928,9 @@ def test_create_entry_group_flattened_error(): @pytest.mark.asyncio async def test_create_entry_group_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -886,7 +964,9 @@ async def test_create_entry_group_flattened_async(): @pytest.mark.asyncio async def test_create_entry_group_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -903,7 +983,8 @@ def test_update_entry_group( transport: str = "grpc", request_type=datacatalog.UpdateEntryGroupRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -946,7 +1027,8 @@ def test_update_entry_group_from_dict(): @pytest.mark.asyncio async def test_update_entry_group_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -985,7 +1067,9 @@ async def test_update_entry_group_async(transport: str = "grpc_asyncio"): def test_update_entry_group_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1007,14 +1091,17 @@ def test_update_entry_group_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "entry_group.name=entry_group.name/value",) in kw[ - "metadata" - ] + assert ( + "x-goog-request-params", + "entry_group.name=entry_group.name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_update_entry_group_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1038,13 +1125,16 @@ async def test_update_entry_group_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "entry_group.name=entry_group.name/value",) in kw[ - "metadata" - ] + assert ( + "x-goog-request-params", + "entry_group.name=entry_group.name/value", + ) in kw["metadata"] def test_update_entry_group_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1071,7 +1161,9 @@ def test_update_entry_group_flattened(): def test_update_entry_group_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1085,7 +1177,9 @@ def test_update_entry_group_flattened_error(): @pytest.mark.asyncio async def test_update_entry_group_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1116,7 +1210,9 @@ async def test_update_entry_group_flattened_async(): @pytest.mark.asyncio async def test_update_entry_group_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1132,7 +1228,8 @@ def test_get_entry_group( transport: str = "grpc", request_type=datacatalog.GetEntryGroupRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1173,7 +1270,8 @@ def test_get_entry_group_from_dict(): @pytest.mark.asyncio async def test_get_entry_group_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1212,7 +1310,9 @@ async def test_get_entry_group_async(transport: str = "grpc_asyncio"): def test_get_entry_group_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1232,12 +1332,17 @@ def test_get_entry_group_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_entry_group_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1261,11 +1366,16 @@ async def test_get_entry_group_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_entry_group_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.get_entry_group), "__call__") as call: @@ -1275,7 +1385,8 @@ def test_get_entry_group_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.get_entry_group( - name="name_value", read_mask=field_mask.FieldMask(paths=["paths_value"]), + name="name_value", + read_mask=field_mask.FieldMask(paths=["paths_value"]), ) # Establish that the underlying call was made with the expected @@ -1289,7 +1400,9 @@ def test_get_entry_group_flattened(): def test_get_entry_group_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1303,7 +1416,9 @@ def test_get_entry_group_flattened_error(): @pytest.mark.asyncio async def test_get_entry_group_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1318,7 +1433,8 @@ async def test_get_entry_group_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.get_entry_group( - name="name_value", read_mask=field_mask.FieldMask(paths=["paths_value"]), + name="name_value", + read_mask=field_mask.FieldMask(paths=["paths_value"]), ) # Establish that the underlying call was made with the expected @@ -1333,7 +1449,9 @@ async def test_get_entry_group_flattened_async(): @pytest.mark.asyncio async def test_get_entry_group_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1349,7 +1467,8 @@ def test_delete_entry_group( transport: str = "grpc", request_type=datacatalog.DeleteEntryGroupRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1382,7 +1501,8 @@ def test_delete_entry_group_from_dict(): @pytest.mark.asyncio async def test_delete_entry_group_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1409,7 +1529,9 @@ async def test_delete_entry_group_async(transport: str = "grpc_asyncio"): def test_delete_entry_group_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1431,12 +1553,17 @@ def test_delete_entry_group_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_entry_group_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1458,11 +1585,16 @@ async def test_delete_entry_group_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_entry_group_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1473,7 +1605,9 @@ def test_delete_entry_group_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_entry_group(name="name_value",) + client.delete_entry_group( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1484,19 +1618,24 @@ def test_delete_entry_group_flattened(): def test_delete_entry_group_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_entry_group( - datacatalog.DeleteEntryGroupRequest(), name="name_value", + datacatalog.DeleteEntryGroupRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_delete_entry_group_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1508,7 +1647,9 @@ async def test_delete_entry_group_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_entry_group(name="name_value",) + response = await client.delete_entry_group( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1520,13 +1661,16 @@ async def test_delete_entry_group_flattened_async(): @pytest.mark.asyncio async def test_delete_entry_group_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_entry_group( - datacatalog.DeleteEntryGroupRequest(), name="name_value", + datacatalog.DeleteEntryGroupRequest(), + name="name_value", ) @@ -1534,7 +1678,8 @@ def test_list_entry_groups( transport: str = "grpc", request_type=datacatalog.ListEntryGroupsRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1571,7 +1716,8 @@ def test_list_entry_groups_from_dict(): @pytest.mark.asyncio async def test_list_entry_groups_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1604,7 +1750,9 @@ async def test_list_entry_groups_async(transport: str = "grpc_asyncio"): def test_list_entry_groups_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1626,12 +1774,17 @@ def test_list_entry_groups_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_list_entry_groups_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1655,11 +1808,16 @@ async def test_list_entry_groups_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_entry_groups_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1670,7 +1828,9 @@ def test_list_entry_groups_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_entry_groups(parent="parent_value",) + client.list_entry_groups( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1681,19 +1841,24 @@ def test_list_entry_groups_flattened(): def test_list_entry_groups_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_entry_groups( - datacatalog.ListEntryGroupsRequest(), parent="parent_value", + datacatalog.ListEntryGroupsRequest(), + parent="parent_value", ) @pytest.mark.asyncio async def test_list_entry_groups_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1707,7 +1872,9 @@ async def test_list_entry_groups_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_entry_groups(parent="parent_value",) + response = await client.list_entry_groups( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1719,18 +1886,23 @@ async def test_list_entry_groups_flattened_async(): @pytest.mark.asyncio async def test_list_entry_groups_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.list_entry_groups( - datacatalog.ListEntryGroupsRequest(), parent="parent_value", + datacatalog.ListEntryGroupsRequest(), + parent="parent_value", ) def test_list_entry_groups_pager(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1747,13 +1919,20 @@ def test_list_entry_groups_pager(): next_page_token="abc", ), datacatalog.ListEntryGroupsResponse( - entry_groups=[], next_page_token="def", + entry_groups=[], + next_page_token="def", ), datacatalog.ListEntryGroupsResponse( - entry_groups=[datacatalog.EntryGroup(),], next_page_token="ghi", + entry_groups=[ + datacatalog.EntryGroup(), + ], + next_page_token="ghi", ), datacatalog.ListEntryGroupsResponse( - entry_groups=[datacatalog.EntryGroup(), datacatalog.EntryGroup(),], + entry_groups=[ + datacatalog.EntryGroup(), + datacatalog.EntryGroup(), + ], ), RuntimeError, ) @@ -1772,7 +1951,9 @@ def test_list_entry_groups_pager(): def test_list_entry_groups_pages(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1789,13 +1970,20 @@ def test_list_entry_groups_pages(): next_page_token="abc", ), datacatalog.ListEntryGroupsResponse( - entry_groups=[], next_page_token="def", + entry_groups=[], + next_page_token="def", ), datacatalog.ListEntryGroupsResponse( - entry_groups=[datacatalog.EntryGroup(),], next_page_token="ghi", + entry_groups=[ + datacatalog.EntryGroup(), + ], + next_page_token="ghi", ), datacatalog.ListEntryGroupsResponse( - entry_groups=[datacatalog.EntryGroup(), datacatalog.EntryGroup(),], + entry_groups=[ + datacatalog.EntryGroup(), + datacatalog.EntryGroup(), + ], ), RuntimeError, ) @@ -1806,7 +1994,9 @@ def test_list_entry_groups_pages(): @pytest.mark.asyncio async def test_list_entry_groups_async_pager(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1825,17 +2015,26 @@ async def test_list_entry_groups_async_pager(): next_page_token="abc", ), datacatalog.ListEntryGroupsResponse( - entry_groups=[], next_page_token="def", + entry_groups=[], + next_page_token="def", ), datacatalog.ListEntryGroupsResponse( - entry_groups=[datacatalog.EntryGroup(),], next_page_token="ghi", + entry_groups=[ + datacatalog.EntryGroup(), + ], + next_page_token="ghi", ), datacatalog.ListEntryGroupsResponse( - entry_groups=[datacatalog.EntryGroup(), datacatalog.EntryGroup(),], + entry_groups=[ + datacatalog.EntryGroup(), + datacatalog.EntryGroup(), + ], ), RuntimeError, ) - async_pager = await client.list_entry_groups(request={},) + async_pager = await client.list_entry_groups( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -1847,7 +2046,9 @@ async def test_list_entry_groups_async_pager(): @pytest.mark.asyncio async def test_list_entry_groups_async_pages(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1866,13 +2067,20 @@ async def test_list_entry_groups_async_pages(): next_page_token="abc", ), datacatalog.ListEntryGroupsResponse( - entry_groups=[], next_page_token="def", + entry_groups=[], + next_page_token="def", ), datacatalog.ListEntryGroupsResponse( - entry_groups=[datacatalog.EntryGroup(),], next_page_token="ghi", + entry_groups=[ + datacatalog.EntryGroup(), + ], + next_page_token="ghi", ), datacatalog.ListEntryGroupsResponse( - entry_groups=[datacatalog.EntryGroup(), datacatalog.EntryGroup(),], + entry_groups=[ + datacatalog.EntryGroup(), + datacatalog.EntryGroup(), + ], ), RuntimeError, ) @@ -1887,7 +2095,8 @@ def test_create_entry( transport: str = "grpc", request_type=datacatalog.CreateEntryRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1936,7 +2145,8 @@ def test_create_entry_from_dict(): @pytest.mark.asyncio async def test_create_entry_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1978,7 +2188,9 @@ async def test_create_entry_async(transport: str = "grpc_asyncio"): def test_create_entry_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1998,12 +2210,17 @@ def test_create_entry_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_entry_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2025,11 +2242,16 @@ async def test_create_entry_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_entry_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.create_entry), "__call__") as call: @@ -2057,7 +2279,9 @@ def test_create_entry_flattened(): def test_create_entry_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -2072,7 +2296,9 @@ def test_create_entry_flattened_error(): @pytest.mark.asyncio async def test_create_entry_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2104,7 +2330,9 @@ async def test_create_entry_flattened_async(): @pytest.mark.asyncio async def test_create_entry_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -2121,7 +2349,8 @@ def test_update_entry( transport: str = "grpc", request_type=datacatalog.UpdateEntryRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2170,7 +2399,8 @@ def test_update_entry_from_dict(): @pytest.mark.asyncio async def test_update_entry_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2212,7 +2442,9 @@ async def test_update_entry_async(transport: str = "grpc_asyncio"): def test_update_entry_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2232,12 +2464,17 @@ def test_update_entry_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "entry.name=entry.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "entry.name=entry.name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_update_entry_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2259,11 +2496,16 @@ async def test_update_entry_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "entry.name=entry.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "entry.name=entry.name/value", + ) in kw["metadata"] def test_update_entry_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.update_entry), "__call__") as call: @@ -2288,7 +2530,9 @@ def test_update_entry_flattened(): def test_update_entry_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -2302,7 +2546,9 @@ def test_update_entry_flattened_error(): @pytest.mark.asyncio async def test_update_entry_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2331,7 +2577,9 @@ async def test_update_entry_flattened_async(): @pytest.mark.asyncio async def test_update_entry_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -2347,7 +2595,8 @@ def test_delete_entry( transport: str = "grpc", request_type=datacatalog.DeleteEntryRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2378,7 +2627,8 @@ def test_delete_entry_from_dict(): @pytest.mark.asyncio async def test_delete_entry_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2405,7 +2655,9 @@ async def test_delete_entry_async(transport: str = "grpc_asyncio"): def test_delete_entry_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2425,12 +2677,17 @@ def test_delete_entry_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_entry_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2452,11 +2709,16 @@ async def test_delete_entry_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_entry_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.delete_entry), "__call__") as call: @@ -2465,7 +2727,9 @@ def test_delete_entry_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_entry(name="name_value",) + client.delete_entry( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2476,19 +2740,24 @@ def test_delete_entry_flattened(): def test_delete_entry_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_entry( - datacatalog.DeleteEntryRequest(), name="name_value", + datacatalog.DeleteEntryRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_delete_entry_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2500,7 +2769,9 @@ async def test_delete_entry_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_entry(name="name_value",) + response = await client.delete_entry( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2512,19 +2783,23 @@ async def test_delete_entry_flattened_async(): @pytest.mark.asyncio async def test_delete_entry_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_entry( - datacatalog.DeleteEntryRequest(), name="name_value", + datacatalog.DeleteEntryRequest(), + name="name_value", ) def test_get_entry(transport: str = "grpc", request_type=datacatalog.GetEntryRequest): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2573,7 +2848,8 @@ def test_get_entry_from_dict(): @pytest.mark.asyncio async def test_get_entry_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2615,7 +2891,9 @@ async def test_get_entry_async(transport: str = "grpc_asyncio"): def test_get_entry_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2635,12 +2913,17 @@ def test_get_entry_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_entry_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2662,11 +2945,16 @@ async def test_get_entry_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_entry_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.get_entry), "__call__") as call: @@ -2675,7 +2963,9 @@ def test_get_entry_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_entry(name="name_value",) + client.get_entry( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2686,19 +2976,24 @@ def test_get_entry_flattened(): def test_get_entry_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_entry( - datacatalog.GetEntryRequest(), name="name_value", + datacatalog.GetEntryRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_get_entry_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2710,7 +3005,9 @@ async def test_get_entry_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(datacatalog.Entry()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_entry(name="name_value",) + response = await client.get_entry( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2722,13 +3019,16 @@ async def test_get_entry_flattened_async(): @pytest.mark.asyncio async def test_get_entry_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_entry( - datacatalog.GetEntryRequest(), name="name_value", + datacatalog.GetEntryRequest(), + name="name_value", ) @@ -2736,7 +3036,8 @@ def test_lookup_entry( transport: str = "grpc", request_type=datacatalog.LookupEntryRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2785,7 +3086,8 @@ def test_lookup_entry_from_dict(): @pytest.mark.asyncio async def test_lookup_entry_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2830,7 +3132,8 @@ def test_list_entries( transport: str = "grpc", request_type=datacatalog.ListEntriesRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2865,7 +3168,8 @@ def test_list_entries_from_dict(): @pytest.mark.asyncio async def test_list_entries_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2878,7 +3182,9 @@ async def test_list_entries_async(transport: str = "grpc_asyncio"): ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - datacatalog.ListEntriesResponse(next_page_token="next_page_token_value",) + datacatalog.ListEntriesResponse( + next_page_token="next_page_token_value", + ) ) response = await client.list_entries(request) @@ -2896,7 +3202,9 @@ async def test_list_entries_async(transport: str = "grpc_asyncio"): def test_list_entries_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2916,12 +3224,17 @@ def test_list_entries_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_list_entries_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2945,11 +3258,16 @@ async def test_list_entries_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_entries_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.list_entries), "__call__") as call: @@ -2958,7 +3276,9 @@ def test_list_entries_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_entries(parent="parent_value",) + client.list_entries( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2969,19 +3289,24 @@ def test_list_entries_flattened(): def test_list_entries_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_entries( - datacatalog.ListEntriesRequest(), parent="parent_value", + datacatalog.ListEntriesRequest(), + parent="parent_value", ) @pytest.mark.asyncio async def test_list_entries_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2995,7 +3320,9 @@ async def test_list_entries_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_entries(parent="parent_value",) + response = await client.list_entries( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3007,18 +3334,23 @@ async def test_list_entries_flattened_async(): @pytest.mark.asyncio async def test_list_entries_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.list_entries( - datacatalog.ListEntriesRequest(), parent="parent_value", + datacatalog.ListEntriesRequest(), + parent="parent_value", ) def test_list_entries_pager(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.list_entries), "__call__") as call: @@ -3032,12 +3364,21 @@ def test_list_entries_pager(): ], next_page_token="abc", ), - datacatalog.ListEntriesResponse(entries=[], next_page_token="def",), datacatalog.ListEntriesResponse( - entries=[datacatalog.Entry(),], next_page_token="ghi", + entries=[], + next_page_token="def", ), datacatalog.ListEntriesResponse( - entries=[datacatalog.Entry(), datacatalog.Entry(),], + entries=[ + datacatalog.Entry(), + ], + next_page_token="ghi", + ), + datacatalog.ListEntriesResponse( + entries=[ + datacatalog.Entry(), + datacatalog.Entry(), + ], ), RuntimeError, ) @@ -3056,7 +3397,9 @@ def test_list_entries_pager(): def test_list_entries_pages(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.list_entries), "__call__") as call: @@ -3070,12 +3413,21 @@ def test_list_entries_pages(): ], next_page_token="abc", ), - datacatalog.ListEntriesResponse(entries=[], next_page_token="def",), datacatalog.ListEntriesResponse( - entries=[datacatalog.Entry(),], next_page_token="ghi", + entries=[], + next_page_token="def", ), datacatalog.ListEntriesResponse( - entries=[datacatalog.Entry(), datacatalog.Entry(),], + entries=[ + datacatalog.Entry(), + ], + next_page_token="ghi", + ), + datacatalog.ListEntriesResponse( + entries=[ + datacatalog.Entry(), + datacatalog.Entry(), + ], ), RuntimeError, ) @@ -3086,7 +3438,9 @@ def test_list_entries_pages(): @pytest.mark.asyncio async def test_list_entries_async_pager(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3104,16 +3458,27 @@ async def test_list_entries_async_pager(): ], next_page_token="abc", ), - datacatalog.ListEntriesResponse(entries=[], next_page_token="def",), datacatalog.ListEntriesResponse( - entries=[datacatalog.Entry(),], next_page_token="ghi", + entries=[], + next_page_token="def", ), datacatalog.ListEntriesResponse( - entries=[datacatalog.Entry(), datacatalog.Entry(),], + entries=[ + datacatalog.Entry(), + ], + next_page_token="ghi", + ), + datacatalog.ListEntriesResponse( + entries=[ + datacatalog.Entry(), + datacatalog.Entry(), + ], ), RuntimeError, ) - async_pager = await client.list_entries(request={},) + async_pager = await client.list_entries( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -3125,7 +3490,9 @@ async def test_list_entries_async_pager(): @pytest.mark.asyncio async def test_list_entries_async_pages(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3143,12 +3510,21 @@ async def test_list_entries_async_pages(): ], next_page_token="abc", ), - datacatalog.ListEntriesResponse(entries=[], next_page_token="def",), datacatalog.ListEntriesResponse( - entries=[datacatalog.Entry(),], next_page_token="ghi", + entries=[], + next_page_token="def", ), datacatalog.ListEntriesResponse( - entries=[datacatalog.Entry(), datacatalog.Entry(),], + entries=[ + datacatalog.Entry(), + ], + next_page_token="ghi", + ), + datacatalog.ListEntriesResponse( + entries=[ + datacatalog.Entry(), + datacatalog.Entry(), + ], ), RuntimeError, ) @@ -3163,7 +3539,8 @@ def test_create_tag_template( transport: str = "grpc", request_type=datacatalog.CreateTagTemplateRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3176,7 +3553,8 @@ def test_create_tag_template( ) as call: # Designate an appropriate return value for the call. call.return_value = tags.TagTemplate( - name="name_value", display_name="display_name_value", + name="name_value", + display_name="display_name_value", ) response = client.create_tag_template(request) @@ -3202,7 +3580,8 @@ def test_create_tag_template_from_dict(): @pytest.mark.asyncio async def test_create_tag_template_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3215,7 +3594,10 @@ async def test_create_tag_template_async(transport: str = "grpc_asyncio"): ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - tags.TagTemplate(name="name_value", display_name="display_name_value",) + tags.TagTemplate( + name="name_value", + display_name="display_name_value", + ) ) response = await client.create_tag_template(request) @@ -3235,7 +3617,9 @@ async def test_create_tag_template_async(transport: str = "grpc_asyncio"): def test_create_tag_template_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3257,12 +3641,17 @@ def test_create_tag_template_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_tag_template_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3284,11 +3673,16 @@ async def test_create_tag_template_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_tag_template_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3318,7 +3712,9 @@ def test_create_tag_template_flattened(): def test_create_tag_template_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -3333,7 +3729,9 @@ def test_create_tag_template_flattened_error(): @pytest.mark.asyncio async def test_create_tag_template_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3365,7 +3763,9 @@ async def test_create_tag_template_flattened_async(): @pytest.mark.asyncio async def test_create_tag_template_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -3382,7 +3782,8 @@ def test_get_tag_template( transport: str = "grpc", request_type=datacatalog.GetTagTemplateRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3395,7 +3796,8 @@ def test_get_tag_template( ) as call: # Designate an appropriate return value for the call. call.return_value = tags.TagTemplate( - name="name_value", display_name="display_name_value", + name="name_value", + display_name="display_name_value", ) response = client.get_tag_template(request) @@ -3421,7 +3823,8 @@ def test_get_tag_template_from_dict(): @pytest.mark.asyncio async def test_get_tag_template_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3434,7 +3837,10 @@ async def test_get_tag_template_async(transport: str = "grpc_asyncio"): ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - tags.TagTemplate(name="name_value", display_name="display_name_value",) + tags.TagTemplate( + name="name_value", + display_name="display_name_value", + ) ) response = await client.get_tag_template(request) @@ -3454,7 +3860,9 @@ async def test_get_tag_template_async(transport: str = "grpc_asyncio"): def test_get_tag_template_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3476,12 +3884,17 @@ def test_get_tag_template_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_tag_template_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3503,11 +3916,16 @@ async def test_get_tag_template_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_tag_template_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3518,7 +3936,9 @@ def test_get_tag_template_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_tag_template(name="name_value",) + client.get_tag_template( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3529,19 +3949,24 @@ def test_get_tag_template_flattened(): def test_get_tag_template_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_tag_template( - datacatalog.GetTagTemplateRequest(), name="name_value", + datacatalog.GetTagTemplateRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_get_tag_template_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3553,7 +3978,9 @@ async def test_get_tag_template_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(tags.TagTemplate()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_tag_template(name="name_value",) + response = await client.get_tag_template( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3565,13 +3992,16 @@ async def test_get_tag_template_flattened_async(): @pytest.mark.asyncio async def test_get_tag_template_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_tag_template( - datacatalog.GetTagTemplateRequest(), name="name_value", + datacatalog.GetTagTemplateRequest(), + name="name_value", ) @@ -3579,7 +4009,8 @@ def test_update_tag_template( transport: str = "grpc", request_type=datacatalog.UpdateTagTemplateRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3592,7 +4023,8 @@ def test_update_tag_template( ) as call: # Designate an appropriate return value for the call. call.return_value = tags.TagTemplate( - name="name_value", display_name="display_name_value", + name="name_value", + display_name="display_name_value", ) response = client.update_tag_template(request) @@ -3618,7 +4050,8 @@ def test_update_tag_template_from_dict(): @pytest.mark.asyncio async def test_update_tag_template_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3631,7 +4064,10 @@ async def test_update_tag_template_async(transport: str = "grpc_asyncio"): ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - tags.TagTemplate(name="name_value", display_name="display_name_value",) + tags.TagTemplate( + name="name_value", + display_name="display_name_value", + ) ) response = await client.update_tag_template(request) @@ -3651,7 +4087,9 @@ async def test_update_tag_template_async(transport: str = "grpc_asyncio"): def test_update_tag_template_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3681,7 +4119,9 @@ def test_update_tag_template_field_headers(): @pytest.mark.asyncio async def test_update_tag_template_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3710,7 +4150,9 @@ async def test_update_tag_template_field_headers_async(): def test_update_tag_template_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3737,7 +4179,9 @@ def test_update_tag_template_flattened(): def test_update_tag_template_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -3751,7 +4195,9 @@ def test_update_tag_template_flattened_error(): @pytest.mark.asyncio async def test_update_tag_template_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3780,7 +4226,9 @@ async def test_update_tag_template_flattened_async(): @pytest.mark.asyncio async def test_update_tag_template_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -3796,7 +4244,8 @@ def test_delete_tag_template( transport: str = "grpc", request_type=datacatalog.DeleteTagTemplateRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3829,7 +4278,8 @@ def test_delete_tag_template_from_dict(): @pytest.mark.asyncio async def test_delete_tag_template_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3856,7 +4306,9 @@ async def test_delete_tag_template_async(transport: str = "grpc_asyncio"): def test_delete_tag_template_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3878,12 +4330,17 @@ def test_delete_tag_template_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_tag_template_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3905,11 +4362,16 @@ async def test_delete_tag_template_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_tag_template_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3921,7 +4383,8 @@ def test_delete_tag_template_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.delete_tag_template( - name="name_value", force=True, + name="name_value", + force=True, ) # Establish that the underlying call was made with the expected @@ -3935,19 +4398,25 @@ def test_delete_tag_template_flattened(): def test_delete_tag_template_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_tag_template( - datacatalog.DeleteTagTemplateRequest(), name="name_value", force=True, + datacatalog.DeleteTagTemplateRequest(), + name="name_value", + force=True, ) @pytest.mark.asyncio async def test_delete_tag_template_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3959,7 +4428,10 @@ async def test_delete_tag_template_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_tag_template(name="name_value", force=True,) + response = await client.delete_tag_template( + name="name_value", + force=True, + ) # Establish that the underlying call was made with the expected # request object values. @@ -3973,13 +4445,17 @@ async def test_delete_tag_template_flattened_async(): @pytest.mark.asyncio async def test_delete_tag_template_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_tag_template( - datacatalog.DeleteTagTemplateRequest(), name="name_value", force=True, + datacatalog.DeleteTagTemplateRequest(), + name="name_value", + force=True, ) @@ -3987,7 +4463,8 @@ def test_create_tag_template_field( transport: str = "grpc", request_type=datacatalog.CreateTagTemplateFieldRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4033,7 +4510,8 @@ def test_create_tag_template_field_from_dict(): @pytest.mark.asyncio async def test_create_tag_template_field_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4075,7 +4553,9 @@ async def test_create_tag_template_field_async(transport: str = "grpc_asyncio"): def test_create_tag_template_field_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4097,12 +4577,17 @@ def test_create_tag_template_field_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_tag_template_field_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4126,11 +4611,16 @@ async def test_create_tag_template_field_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_tag_template_field_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4160,7 +4650,9 @@ def test_create_tag_template_field_flattened(): def test_create_tag_template_field_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4175,7 +4667,9 @@ def test_create_tag_template_field_flattened_error(): @pytest.mark.asyncio async def test_create_tag_template_field_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4209,7 +4703,9 @@ async def test_create_tag_template_field_flattened_async(): @pytest.mark.asyncio async def test_create_tag_template_field_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4226,7 +4722,8 @@ def test_update_tag_template_field( transport: str = "grpc", request_type=datacatalog.UpdateTagTemplateFieldRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4272,7 +4769,8 @@ def test_update_tag_template_field_from_dict(): @pytest.mark.asyncio async def test_update_tag_template_field_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4314,7 +4812,9 @@ async def test_update_tag_template_field_async(transport: str = "grpc_asyncio"): def test_update_tag_template_field_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4336,12 +4836,17 @@ def test_update_tag_template_field_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_update_tag_template_field_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4365,11 +4870,16 @@ async def test_update_tag_template_field_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_update_tag_template_field_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4399,7 +4909,9 @@ def test_update_tag_template_field_flattened(): def test_update_tag_template_field_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4414,7 +4926,9 @@ def test_update_tag_template_field_flattened_error(): @pytest.mark.asyncio async def test_update_tag_template_field_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4448,7 +4962,9 @@ async def test_update_tag_template_field_flattened_async(): @pytest.mark.asyncio async def test_update_tag_template_field_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4465,7 +4981,8 @@ def test_rename_tag_template_field( transport: str = "grpc", request_type=datacatalog.RenameTagTemplateFieldRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4511,7 +5028,8 @@ def test_rename_tag_template_field_from_dict(): @pytest.mark.asyncio async def test_rename_tag_template_field_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4553,7 +5071,9 @@ async def test_rename_tag_template_field_async(transport: str = "grpc_asyncio"): def test_rename_tag_template_field_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4575,12 +5095,17 @@ def test_rename_tag_template_field_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_rename_tag_template_field_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4604,11 +5129,16 @@ async def test_rename_tag_template_field_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_rename_tag_template_field_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4635,7 +5165,9 @@ def test_rename_tag_template_field_flattened(): def test_rename_tag_template_field_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4649,7 +5181,9 @@ def test_rename_tag_template_field_flattened_error(): @pytest.mark.asyncio async def test_rename_tag_template_field_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4680,7 +5214,9 @@ async def test_rename_tag_template_field_flattened_async(): @pytest.mark.asyncio async def test_rename_tag_template_field_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4696,7 +5232,8 @@ def test_delete_tag_template_field( transport: str = "grpc", request_type=datacatalog.DeleteTagTemplateFieldRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4729,7 +5266,8 @@ def test_delete_tag_template_field_from_dict(): @pytest.mark.asyncio async def test_delete_tag_template_field_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4756,7 +5294,9 @@ async def test_delete_tag_template_field_async(transport: str = "grpc_asyncio"): def test_delete_tag_template_field_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4778,12 +5318,17 @@ def test_delete_tag_template_field_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_tag_template_field_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4805,11 +5350,16 @@ async def test_delete_tag_template_field_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_tag_template_field_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4821,7 +5371,8 @@ def test_delete_tag_template_field_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.delete_tag_template_field( - name="name_value", force=True, + name="name_value", + force=True, ) # Establish that the underlying call was made with the expected @@ -4835,19 +5386,25 @@ def test_delete_tag_template_field_flattened(): def test_delete_tag_template_field_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_tag_template_field( - datacatalog.DeleteTagTemplateFieldRequest(), name="name_value", force=True, + datacatalog.DeleteTagTemplateFieldRequest(), + name="name_value", + force=True, ) @pytest.mark.asyncio async def test_delete_tag_template_field_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4860,7 +5417,8 @@ async def test_delete_tag_template_field_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.delete_tag_template_field( - name="name_value", force=True, + name="name_value", + force=True, ) # Establish that the underlying call was made with the expected @@ -4875,19 +5433,24 @@ async def test_delete_tag_template_field_flattened_async(): @pytest.mark.asyncio async def test_delete_tag_template_field_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_tag_template_field( - datacatalog.DeleteTagTemplateFieldRequest(), name="name_value", force=True, + datacatalog.DeleteTagTemplateFieldRequest(), + name="name_value", + force=True, ) def test_create_tag(transport: str = "grpc", request_type=datacatalog.CreateTagRequest): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4929,7 +5492,8 @@ def test_create_tag_from_dict(): @pytest.mark.asyncio async def test_create_tag_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4968,7 +5532,9 @@ async def test_create_tag_async(transport: str = "grpc_asyncio"): def test_create_tag_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4988,12 +5554,17 @@ def test_create_tag_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_tag_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5015,11 +5586,16 @@ async def test_create_tag_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_tag_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.create_tag), "__call__") as call: @@ -5029,7 +5605,8 @@ def test_create_tag_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.create_tag( - parent="parent_value", tag=tags.Tag(name="name_value"), + parent="parent_value", + tag=tags.Tag(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -5043,7 +5620,9 @@ def test_create_tag_flattened(): def test_create_tag_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -5057,7 +5636,9 @@ def test_create_tag_flattened_error(): @pytest.mark.asyncio async def test_create_tag_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5070,7 +5651,8 @@ async def test_create_tag_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.create_tag( - parent="parent_value", tag=tags.Tag(name="name_value"), + parent="parent_value", + tag=tags.Tag(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -5085,7 +5667,9 @@ async def test_create_tag_flattened_async(): @pytest.mark.asyncio async def test_create_tag_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -5099,7 +5683,8 @@ async def test_create_tag_flattened_error_async(): def test_update_tag(transport: str = "grpc", request_type=datacatalog.UpdateTagRequest): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5141,7 +5726,8 @@ def test_update_tag_from_dict(): @pytest.mark.asyncio async def test_update_tag_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5180,7 +5766,9 @@ async def test_update_tag_async(transport: str = "grpc_asyncio"): def test_update_tag_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5200,12 +5788,17 @@ def test_update_tag_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "tag.name=tag.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "tag.name=tag.name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_update_tag_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5227,11 +5820,16 @@ async def test_update_tag_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "tag.name=tag.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "tag.name=tag.name/value", + ) in kw["metadata"] def test_update_tag_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.update_tag), "__call__") as call: @@ -5256,7 +5854,9 @@ def test_update_tag_flattened(): def test_update_tag_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -5270,7 +5870,9 @@ def test_update_tag_flattened_error(): @pytest.mark.asyncio async def test_update_tag_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5299,7 +5901,9 @@ async def test_update_tag_flattened_async(): @pytest.mark.asyncio async def test_update_tag_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -5313,7 +5917,8 @@ async def test_update_tag_flattened_error_async(): def test_delete_tag(transport: str = "grpc", request_type=datacatalog.DeleteTagRequest): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5344,7 +5949,8 @@ def test_delete_tag_from_dict(): @pytest.mark.asyncio async def test_delete_tag_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5371,7 +5977,9 @@ async def test_delete_tag_async(transport: str = "grpc_asyncio"): def test_delete_tag_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5391,12 +5999,17 @@ def test_delete_tag_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_tag_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5418,11 +6031,16 @@ async def test_delete_tag_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_tag_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.delete_tag), "__call__") as call: @@ -5431,7 +6049,9 @@ def test_delete_tag_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_tag(name="name_value",) + client.delete_tag( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5442,19 +6062,24 @@ def test_delete_tag_flattened(): def test_delete_tag_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_tag( - datacatalog.DeleteTagRequest(), name="name_value", + datacatalog.DeleteTagRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_delete_tag_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5466,7 +6091,9 @@ async def test_delete_tag_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_tag(name="name_value",) + response = await client.delete_tag( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5478,19 +6105,23 @@ async def test_delete_tag_flattened_async(): @pytest.mark.asyncio async def test_delete_tag_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_tag( - datacatalog.DeleteTagRequest(), name="name_value", + datacatalog.DeleteTagRequest(), + name="name_value", ) def test_list_tags(transport: str = "grpc", request_type=datacatalog.ListTagsRequest): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5525,7 +6156,8 @@ def test_list_tags_from_dict(): @pytest.mark.asyncio async def test_list_tags_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5538,7 +6170,9 @@ async def test_list_tags_async(transport: str = "grpc_asyncio"): ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - datacatalog.ListTagsResponse(next_page_token="next_page_token_value",) + datacatalog.ListTagsResponse( + next_page_token="next_page_token_value", + ) ) response = await client.list_tags(request) @@ -5556,7 +6190,9 @@ async def test_list_tags_async(transport: str = "grpc_asyncio"): def test_list_tags_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5576,12 +6212,17 @@ def test_list_tags_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_list_tags_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5605,11 +6246,16 @@ async def test_list_tags_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_tags_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.list_tags), "__call__") as call: @@ -5618,7 +6264,9 @@ def test_list_tags_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_tags(parent="parent_value",) + client.list_tags( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5629,19 +6277,24 @@ def test_list_tags_flattened(): def test_list_tags_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_tags( - datacatalog.ListTagsRequest(), parent="parent_value", + datacatalog.ListTagsRequest(), + parent="parent_value", ) @pytest.mark.asyncio async def test_list_tags_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5655,7 +6308,9 @@ async def test_list_tags_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_tags(parent="parent_value",) + response = await client.list_tags( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5667,29 +6322,52 @@ async def test_list_tags_flattened_async(): @pytest.mark.asyncio async def test_list_tags_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.list_tags( - datacatalog.ListTagsRequest(), parent="parent_value", + datacatalog.ListTagsRequest(), + parent="parent_value", ) def test_list_tags_pager(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.list_tags), "__call__") as call: # Set the response to a series of pages. call.side_effect = ( datacatalog.ListTagsResponse( - tags=[tags.Tag(), tags.Tag(), tags.Tag(),], next_page_token="abc", + tags=[ + tags.Tag(), + tags.Tag(), + tags.Tag(), + ], + next_page_token="abc", + ), + datacatalog.ListTagsResponse( + tags=[], + next_page_token="def", + ), + datacatalog.ListTagsResponse( + tags=[ + tags.Tag(), + ], + next_page_token="ghi", + ), + datacatalog.ListTagsResponse( + tags=[ + tags.Tag(), + tags.Tag(), + ], ), - datacatalog.ListTagsResponse(tags=[], next_page_token="def",), - datacatalog.ListTagsResponse(tags=[tags.Tag(),], next_page_token="ghi",), - datacatalog.ListTagsResponse(tags=[tags.Tag(), tags.Tag(),],), RuntimeError, ) @@ -5707,18 +6385,38 @@ def test_list_tags_pager(): def test_list_tags_pages(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.list_tags), "__call__") as call: # Set the response to a series of pages. call.side_effect = ( datacatalog.ListTagsResponse( - tags=[tags.Tag(), tags.Tag(), tags.Tag(),], next_page_token="abc", + tags=[ + tags.Tag(), + tags.Tag(), + tags.Tag(), + ], + next_page_token="abc", + ), + datacatalog.ListTagsResponse( + tags=[], + next_page_token="def", + ), + datacatalog.ListTagsResponse( + tags=[ + tags.Tag(), + ], + next_page_token="ghi", + ), + datacatalog.ListTagsResponse( + tags=[ + tags.Tag(), + tags.Tag(), + ], ), - datacatalog.ListTagsResponse(tags=[], next_page_token="def",), - datacatalog.ListTagsResponse(tags=[tags.Tag(),], next_page_token="ghi",), - datacatalog.ListTagsResponse(tags=[tags.Tag(), tags.Tag(),],), RuntimeError, ) pages = list(client.list_tags(request={}).pages) @@ -5728,7 +6426,9 @@ def test_list_tags_pages(): @pytest.mark.asyncio async def test_list_tags_async_pager(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5739,14 +6439,34 @@ async def test_list_tags_async_pager(): # Set the response to a series of pages. call.side_effect = ( datacatalog.ListTagsResponse( - tags=[tags.Tag(), tags.Tag(), tags.Tag(),], next_page_token="abc", + tags=[ + tags.Tag(), + tags.Tag(), + tags.Tag(), + ], + next_page_token="abc", + ), + datacatalog.ListTagsResponse( + tags=[], + next_page_token="def", + ), + datacatalog.ListTagsResponse( + tags=[ + tags.Tag(), + ], + next_page_token="ghi", + ), + datacatalog.ListTagsResponse( + tags=[ + tags.Tag(), + tags.Tag(), + ], ), - datacatalog.ListTagsResponse(tags=[], next_page_token="def",), - datacatalog.ListTagsResponse(tags=[tags.Tag(),], next_page_token="ghi",), - datacatalog.ListTagsResponse(tags=[tags.Tag(), tags.Tag(),],), RuntimeError, ) - async_pager = await client.list_tags(request={},) + async_pager = await client.list_tags( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -5758,7 +6478,9 @@ async def test_list_tags_async_pager(): @pytest.mark.asyncio async def test_list_tags_async_pages(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials,) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5769,11 +6491,29 @@ async def test_list_tags_async_pages(): # Set the response to a series of pages. call.side_effect = ( datacatalog.ListTagsResponse( - tags=[tags.Tag(), tags.Tag(), tags.Tag(),], next_page_token="abc", + tags=[ + tags.Tag(), + tags.Tag(), + tags.Tag(), + ], + next_page_token="abc", + ), + datacatalog.ListTagsResponse( + tags=[], + next_page_token="def", + ), + datacatalog.ListTagsResponse( + tags=[ + tags.Tag(), + ], + next_page_token="ghi", + ), + datacatalog.ListTagsResponse( + tags=[ + tags.Tag(), + tags.Tag(), + ], ), - datacatalog.ListTagsResponse(tags=[], next_page_token="def",), - datacatalog.ListTagsResponse(tags=[tags.Tag(),], next_page_token="ghi",), - datacatalog.ListTagsResponse(tags=[tags.Tag(), tags.Tag(),],), RuntimeError, ) pages = [] @@ -5787,7 +6527,8 @@ def test_set_iam_policy( transport: str = "grpc", request_type=iam_policy.SetIamPolicyRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5797,7 +6538,10 @@ def test_set_iam_policy( # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.set_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. - call.return_value = policy.Policy(version=774, etag=b"etag_blob",) + call.return_value = policy.Policy( + version=774, + etag=b"etag_blob", + ) response = client.set_iam_policy(request) @@ -5822,7 +6566,8 @@ def test_set_iam_policy_from_dict(): @pytest.mark.asyncio async def test_set_iam_policy_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5835,7 +6580,10 @@ async def test_set_iam_policy_async(transport: str = "grpc_asyncio"): ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - policy.Policy(version=774, etag=b"etag_blob",) + policy.Policy( + version=774, + etag=b"etag_blob", + ) ) response = await client.set_iam_policy(request) @@ -5855,7 +6603,9 @@ async def test_set_iam_policy_async(transport: str = "grpc_asyncio"): def test_set_iam_policy_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5875,12 +6625,17 @@ def test_set_iam_policy_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_set_iam_policy_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5902,11 +6657,16 @@ async def test_set_iam_policy_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] def test_set_iam_policy_from_dict(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.set_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. @@ -5922,7 +6682,9 @@ def test_set_iam_policy_from_dict(): def test_set_iam_policy_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.set_iam_policy), "__call__") as call: @@ -5931,7 +6693,9 @@ def test_set_iam_policy_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.set_iam_policy(resource="resource_value",) + client.set_iam_policy( + resource="resource_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5942,19 +6706,24 @@ def test_set_iam_policy_flattened(): def test_set_iam_policy_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.set_iam_policy( - iam_policy.SetIamPolicyRequest(), resource="resource_value", + iam_policy.SetIamPolicyRequest(), + resource="resource_value", ) @pytest.mark.asyncio async def test_set_iam_policy_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5966,7 +6735,9 @@ async def test_set_iam_policy_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(policy.Policy()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.set_iam_policy(resource="resource_value",) + response = await client.set_iam_policy( + resource="resource_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5978,13 +6749,16 @@ async def test_set_iam_policy_flattened_async(): @pytest.mark.asyncio async def test_set_iam_policy_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.set_iam_policy( - iam_policy.SetIamPolicyRequest(), resource="resource_value", + iam_policy.SetIamPolicyRequest(), + resource="resource_value", ) @@ -5992,7 +6766,8 @@ def test_get_iam_policy( transport: str = "grpc", request_type=iam_policy.GetIamPolicyRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -6002,7 +6777,10 @@ def test_get_iam_policy( # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.get_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. - call.return_value = policy.Policy(version=774, etag=b"etag_blob",) + call.return_value = policy.Policy( + version=774, + etag=b"etag_blob", + ) response = client.get_iam_policy(request) @@ -6027,7 +6805,8 @@ def test_get_iam_policy_from_dict(): @pytest.mark.asyncio async def test_get_iam_policy_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -6040,7 +6819,10 @@ async def test_get_iam_policy_async(transport: str = "grpc_asyncio"): ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - policy.Policy(version=774, etag=b"etag_blob",) + policy.Policy( + version=774, + etag=b"etag_blob", + ) ) response = await client.get_iam_policy(request) @@ -6060,7 +6842,9 @@ async def test_get_iam_policy_async(transport: str = "grpc_asyncio"): def test_get_iam_policy_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -6080,12 +6864,17 @@ def test_get_iam_policy_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_iam_policy_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -6107,11 +6896,16 @@ async def test_get_iam_policy_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] def test_get_iam_policy_from_dict(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.get_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. @@ -6127,7 +6921,9 @@ def test_get_iam_policy_from_dict(): def test_get_iam_policy_flattened(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.get_iam_policy), "__call__") as call: @@ -6136,7 +6932,9 @@ def test_get_iam_policy_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_iam_policy(resource="resource_value",) + client.get_iam_policy( + resource="resource_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -6147,19 +6945,24 @@ def test_get_iam_policy_flattened(): def test_get_iam_policy_flattened_error(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_iam_policy( - iam_policy.GetIamPolicyRequest(), resource="resource_value", + iam_policy.GetIamPolicyRequest(), + resource="resource_value", ) @pytest.mark.asyncio async def test_get_iam_policy_flattened_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6171,7 +6974,9 @@ async def test_get_iam_policy_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(policy.Policy()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_iam_policy(resource="resource_value",) + response = await client.get_iam_policy( + resource="resource_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -6183,13 +6988,16 @@ async def test_get_iam_policy_flattened_async(): @pytest.mark.asyncio async def test_get_iam_policy_flattened_error_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_iam_policy( - iam_policy.GetIamPolicyRequest(), resource="resource_value", + iam_policy.GetIamPolicyRequest(), + resource="resource_value", ) @@ -6197,7 +7005,8 @@ def test_test_iam_permissions( transport: str = "grpc", request_type=iam_policy.TestIamPermissionsRequest ): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -6234,7 +7043,8 @@ def test_test_iam_permissions_from_dict(): @pytest.mark.asyncio async def test_test_iam_permissions_async(transport: str = "grpc_asyncio"): client = DataCatalogAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -6247,7 +7057,9 @@ async def test_test_iam_permissions_async(transport: str = "grpc_asyncio"): ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - iam_policy.TestIamPermissionsResponse(permissions=["permissions_value"],) + iam_policy.TestIamPermissionsResponse( + permissions=["permissions_value"], + ) ) response = await client.test_iam_permissions(request) @@ -6265,7 +7077,9 @@ async def test_test_iam_permissions_async(transport: str = "grpc_asyncio"): def test_test_iam_permissions_field_headers(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -6287,12 +7101,17 @@ def test_test_iam_permissions_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_test_iam_permissions_field_headers_async(): - client = DataCatalogAsyncClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogAsyncClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -6316,11 +7135,16 @@ async def test_test_iam_permissions_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] def test_test_iam_permissions_from_dict(): - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client._transport.test_iam_permissions), "__call__" @@ -6344,7 +7168,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = DataCatalogClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # It is an error to provide a credentials file and a transport instance. @@ -6363,7 +7188,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = DataCatalogClient( - client_options={"scopes": ["1", "2"]}, transport=transport, + client_options={"scopes": ["1", "2"]}, + transport=transport, ) @@ -6393,8 +7219,13 @@ def test_transport_get_channel(): def test_transport_grpc_default(): # A client should use the gRPC transport by default. - client = DataCatalogClient(credentials=credentials.AnonymousCredentials(),) - assert isinstance(client._transport, transports.DataCatalogGrpcTransport,) + client = DataCatalogClient( + credentials=credentials.AnonymousCredentials(), + ) + assert isinstance( + client._transport, + transports.DataCatalogGrpcTransport, + ) def test_data_catalog_base_transport_error(): @@ -6462,7 +7293,8 @@ def test_data_catalog_base_transport_with_credentials_file(): Transport.return_value = None load_creds.return_value = (credentials.AnonymousCredentials(), None) transport = transports.DataCatalogTransport( - credentials_file="credentials.json", quota_project_id="octopus", + credentials_file="credentials.json", + quota_project_id="octopus", ) load_creds.assert_called_once_with( "credentials.json", @@ -6699,8 +7531,12 @@ def test_tag_template_path(): location = "clam" tag_template = "whelk" - expected = "projects/{project}/locations/{location}/tagTemplates/{tag_template}".format( - project=project, location=location, tag_template=tag_template, + expected = ( + "projects/{project}/locations/{location}/tagTemplates/{tag_template}".format( + project=project, + location=location, + tag_template=tag_template, + ) ) actual = DataCatalogClient.tag_template_path(project, location, tag_template) assert expected == actual @@ -6726,7 +7562,10 @@ def test_entry_path(): entry = "octopus" expected = "projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}".format( - project=project, location=location, entry_group=entry_group, entry=entry, + project=project, + location=location, + entry_group=entry_group, + entry=entry, ) actual = DataCatalogClient.entry_path(project, location, entry_group, entry) assert expected == actual @@ -6751,8 +7590,12 @@ def test_entry_group_path(): location = "clam" entry_group = "whelk" - expected = "projects/{project}/locations/{location}/entryGroups/{entry_group}".format( - project=project, location=location, entry_group=entry_group, + expected = ( + "projects/{project}/locations/{location}/entryGroups/{entry_group}".format( + project=project, + location=location, + entry_group=entry_group, + ) ) actual = DataCatalogClient.entry_group_path(project, location, entry_group) assert expected == actual @@ -6778,7 +7621,10 @@ def test_tag_template_field_path(): field = "octopus" expected = "projects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{field}".format( - project=project, location=location, tag_template=tag_template, field=field, + project=project, + location=location, + tag_template=tag_template, + field=field, ) actual = DataCatalogClient.tag_template_field_path( project, location, tag_template, field diff --git a/tests/unit/gapic/datacatalog_v1beta1/test_policy_tag_manager.py b/tests/unit/gapic/datacatalog_v1beta1/test_policy_tag_manager.py index de5f0342..cc19786e 100644 --- a/tests/unit/gapic/datacatalog_v1beta1/test_policy_tag_manager.py +++ b/tests/unit/gapic/datacatalog_v1beta1/test_policy_tag_manager.py @@ -298,7 +298,9 @@ def test_policy_tag_manager_client_client_options_scopes( client_class, transport_class, transport_name ): # Check the case scopes are provided. - options = client_options.ClientOptions(scopes=["1", "2"],) + options = client_options.ClientOptions( + scopes=["1", "2"], + ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options) @@ -366,7 +368,8 @@ def test_create_taxonomy( transport: str = "grpc", request_type=policytagmanager.CreateTaxonomyRequest ): client = PolicyTagManagerClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -414,7 +417,8 @@ def test_create_taxonomy_from_dict(): @pytest.mark.asyncio async def test_create_taxonomy_async(transport: str = "grpc_asyncio"): client = PolicyTagManagerAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -460,7 +464,9 @@ async def test_create_taxonomy_async(transport: str = "grpc_asyncio"): def test_create_taxonomy_field_headers(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -480,7 +486,10 @@ def test_create_taxonomy_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -511,11 +520,16 @@ async def test_create_taxonomy_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_taxonomy_flattened(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.create_taxonomy), "__call__") as call: @@ -540,7 +554,9 @@ def test_create_taxonomy_flattened(): def test_create_taxonomy_flattened_error(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -605,7 +621,8 @@ def test_delete_taxonomy( transport: str = "grpc", request_type=policytagmanager.DeleteTaxonomyRequest ): client = PolicyTagManagerClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -636,7 +653,8 @@ def test_delete_taxonomy_from_dict(): @pytest.mark.asyncio async def test_delete_taxonomy_async(transport: str = "grpc_asyncio"): client = PolicyTagManagerAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -663,7 +681,9 @@ async def test_delete_taxonomy_async(transport: str = "grpc_asyncio"): def test_delete_taxonomy_field_headers(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -683,7 +703,10 @@ def test_delete_taxonomy_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -712,11 +735,16 @@ async def test_delete_taxonomy_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_taxonomy_flattened(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.delete_taxonomy), "__call__") as call: @@ -725,7 +753,9 @@ def test_delete_taxonomy_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_taxonomy(name="name_value",) + client.delete_taxonomy( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -736,13 +766,16 @@ def test_delete_taxonomy_flattened(): def test_delete_taxonomy_flattened_error(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_taxonomy( - policytagmanager.DeleteTaxonomyRequest(), name="name_value", + policytagmanager.DeleteTaxonomyRequest(), + name="name_value", ) @@ -762,7 +795,9 @@ async def test_delete_taxonomy_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_taxonomy(name="name_value",) + response = await client.delete_taxonomy( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -782,7 +817,8 @@ async def test_delete_taxonomy_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.delete_taxonomy( - policytagmanager.DeleteTaxonomyRequest(), name="name_value", + policytagmanager.DeleteTaxonomyRequest(), + name="name_value", ) @@ -790,7 +826,8 @@ def test_update_taxonomy( transport: str = "grpc", request_type=policytagmanager.UpdateTaxonomyRequest ): client = PolicyTagManagerClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -838,7 +875,8 @@ def test_update_taxonomy_from_dict(): @pytest.mark.asyncio async def test_update_taxonomy_async(transport: str = "grpc_asyncio"): client = PolicyTagManagerAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -884,7 +922,9 @@ async def test_update_taxonomy_async(transport: str = "grpc_asyncio"): def test_update_taxonomy_field_headers(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -904,9 +944,10 @@ def test_update_taxonomy_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "taxonomy.name=taxonomy.name/value",) in kw[ - "metadata" - ] + assert ( + "x-goog-request-params", + "taxonomy.name=taxonomy.name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -937,13 +978,16 @@ async def test_update_taxonomy_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "taxonomy.name=taxonomy.name/value",) in kw[ - "metadata" - ] + assert ( + "x-goog-request-params", + "taxonomy.name=taxonomy.name/value", + ) in kw["metadata"] def test_update_taxonomy_flattened(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.update_taxonomy), "__call__") as call: @@ -952,7 +996,9 @@ def test_update_taxonomy_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.update_taxonomy(taxonomy=policytagmanager.Taxonomy(name="name_value"),) + client.update_taxonomy( + taxonomy=policytagmanager.Taxonomy(name="name_value"), + ) # Establish that the underlying call was made with the expected # request object values. @@ -963,7 +1009,9 @@ def test_update_taxonomy_flattened(): def test_update_taxonomy_flattened_error(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1023,7 +1071,8 @@ def test_list_taxonomies( transport: str = "grpc", request_type=policytagmanager.ListTaxonomiesRequest ): client = PolicyTagManagerClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1058,7 +1107,8 @@ def test_list_taxonomies_from_dict(): @pytest.mark.asyncio async def test_list_taxonomies_async(transport: str = "grpc_asyncio"): client = PolicyTagManagerAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1091,7 +1141,9 @@ async def test_list_taxonomies_async(transport: str = "grpc_asyncio"): def test_list_taxonomies_field_headers(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1111,7 +1163,10 @@ def test_list_taxonomies_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1142,11 +1197,16 @@ async def test_list_taxonomies_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_taxonomies_flattened(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.list_taxonomies), "__call__") as call: @@ -1155,7 +1215,9 @@ def test_list_taxonomies_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_taxonomies(parent="parent_value",) + client.list_taxonomies( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1166,13 +1228,16 @@ def test_list_taxonomies_flattened(): def test_list_taxonomies_flattened_error(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_taxonomies( - policytagmanager.ListTaxonomiesRequest(), parent="parent_value", + policytagmanager.ListTaxonomiesRequest(), + parent="parent_value", ) @@ -1194,7 +1259,9 @@ async def test_list_taxonomies_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_taxonomies(parent="parent_value",) + response = await client.list_taxonomies( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1214,12 +1281,15 @@ async def test_list_taxonomies_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.list_taxonomies( - policytagmanager.ListTaxonomiesRequest(), parent="parent_value", + policytagmanager.ListTaxonomiesRequest(), + parent="parent_value", ) def test_list_taxonomies_pager(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials,) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.list_taxonomies), "__call__") as call: @@ -1234,13 +1304,20 @@ def test_list_taxonomies_pager(): next_page_token="abc", ), policytagmanager.ListTaxonomiesResponse( - taxonomies=[], next_page_token="def", + taxonomies=[], + next_page_token="def", ), policytagmanager.ListTaxonomiesResponse( - taxonomies=[policytagmanager.Taxonomy(),], next_page_token="ghi", + taxonomies=[ + policytagmanager.Taxonomy(), + ], + next_page_token="ghi", ), policytagmanager.ListTaxonomiesResponse( - taxonomies=[policytagmanager.Taxonomy(), policytagmanager.Taxonomy(),], + taxonomies=[ + policytagmanager.Taxonomy(), + policytagmanager.Taxonomy(), + ], ), RuntimeError, ) @@ -1259,7 +1336,9 @@ def test_list_taxonomies_pager(): def test_list_taxonomies_pages(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials,) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.list_taxonomies), "__call__") as call: @@ -1274,13 +1353,20 @@ def test_list_taxonomies_pages(): next_page_token="abc", ), policytagmanager.ListTaxonomiesResponse( - taxonomies=[], next_page_token="def", + taxonomies=[], + next_page_token="def", ), policytagmanager.ListTaxonomiesResponse( - taxonomies=[policytagmanager.Taxonomy(),], next_page_token="ghi", + taxonomies=[ + policytagmanager.Taxonomy(), + ], + next_page_token="ghi", ), policytagmanager.ListTaxonomiesResponse( - taxonomies=[policytagmanager.Taxonomy(), policytagmanager.Taxonomy(),], + taxonomies=[ + policytagmanager.Taxonomy(), + policytagmanager.Taxonomy(), + ], ), RuntimeError, ) @@ -1291,7 +1377,9 @@ def test_list_taxonomies_pages(): @pytest.mark.asyncio async def test_list_taxonomies_async_pager(): - client = PolicyTagManagerAsyncClient(credentials=credentials.AnonymousCredentials,) + client = PolicyTagManagerAsyncClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1310,17 +1398,26 @@ async def test_list_taxonomies_async_pager(): next_page_token="abc", ), policytagmanager.ListTaxonomiesResponse( - taxonomies=[], next_page_token="def", + taxonomies=[], + next_page_token="def", ), policytagmanager.ListTaxonomiesResponse( - taxonomies=[policytagmanager.Taxonomy(),], next_page_token="ghi", + taxonomies=[ + policytagmanager.Taxonomy(), + ], + next_page_token="ghi", ), policytagmanager.ListTaxonomiesResponse( - taxonomies=[policytagmanager.Taxonomy(), policytagmanager.Taxonomy(),], + taxonomies=[ + policytagmanager.Taxonomy(), + policytagmanager.Taxonomy(), + ], ), RuntimeError, ) - async_pager = await client.list_taxonomies(request={},) + async_pager = await client.list_taxonomies( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -1332,7 +1429,9 @@ async def test_list_taxonomies_async_pager(): @pytest.mark.asyncio async def test_list_taxonomies_async_pages(): - client = PolicyTagManagerAsyncClient(credentials=credentials.AnonymousCredentials,) + client = PolicyTagManagerAsyncClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1351,13 +1450,20 @@ async def test_list_taxonomies_async_pages(): next_page_token="abc", ), policytagmanager.ListTaxonomiesResponse( - taxonomies=[], next_page_token="def", + taxonomies=[], + next_page_token="def", ), policytagmanager.ListTaxonomiesResponse( - taxonomies=[policytagmanager.Taxonomy(),], next_page_token="ghi", + taxonomies=[ + policytagmanager.Taxonomy(), + ], + next_page_token="ghi", ), policytagmanager.ListTaxonomiesResponse( - taxonomies=[policytagmanager.Taxonomy(), policytagmanager.Taxonomy(),], + taxonomies=[ + policytagmanager.Taxonomy(), + policytagmanager.Taxonomy(), + ], ), RuntimeError, ) @@ -1372,7 +1478,8 @@ def test_get_taxonomy( transport: str = "grpc", request_type=policytagmanager.GetTaxonomyRequest ): client = PolicyTagManagerClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1420,7 +1527,8 @@ def test_get_taxonomy_from_dict(): @pytest.mark.asyncio async def test_get_taxonomy_async(transport: str = "grpc_asyncio"): client = PolicyTagManagerAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1466,7 +1574,9 @@ async def test_get_taxonomy_async(transport: str = "grpc_asyncio"): def test_get_taxonomy_field_headers(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1486,7 +1596,10 @@ def test_get_taxonomy_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1517,11 +1630,16 @@ async def test_get_taxonomy_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_taxonomy_flattened(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.get_taxonomy), "__call__") as call: @@ -1530,7 +1648,9 @@ def test_get_taxonomy_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_taxonomy(name="name_value",) + client.get_taxonomy( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1541,13 +1661,16 @@ def test_get_taxonomy_flattened(): def test_get_taxonomy_flattened_error(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_taxonomy( - policytagmanager.GetTaxonomyRequest(), name="name_value", + policytagmanager.GetTaxonomyRequest(), + name="name_value", ) @@ -1569,7 +1692,9 @@ async def test_get_taxonomy_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_taxonomy(name="name_value",) + response = await client.get_taxonomy( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1589,7 +1714,8 @@ async def test_get_taxonomy_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.get_taxonomy( - policytagmanager.GetTaxonomyRequest(), name="name_value", + policytagmanager.GetTaxonomyRequest(), + name="name_value", ) @@ -1597,7 +1723,8 @@ def test_create_policy_tag( transport: str = "grpc", request_type=policytagmanager.CreatePolicyTagRequest ): client = PolicyTagManagerClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1646,7 +1773,8 @@ def test_create_policy_tag_from_dict(): @pytest.mark.asyncio async def test_create_policy_tag_async(transport: str = "grpc_asyncio"): client = PolicyTagManagerAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1691,7 +1819,9 @@ async def test_create_policy_tag_async(transport: str = "grpc_asyncio"): def test_create_policy_tag_field_headers(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1713,7 +1843,10 @@ def test_create_policy_tag_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1744,11 +1877,16 @@ async def test_create_policy_tag_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_policy_tag_flattened(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1775,7 +1913,9 @@ def test_create_policy_tag_flattened(): def test_create_policy_tag_flattened_error(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1840,7 +1980,8 @@ def test_delete_policy_tag( transport: str = "grpc", request_type=policytagmanager.DeletePolicyTagRequest ): client = PolicyTagManagerClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1873,7 +2014,8 @@ def test_delete_policy_tag_from_dict(): @pytest.mark.asyncio async def test_delete_policy_tag_async(transport: str = "grpc_asyncio"): client = PolicyTagManagerAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1900,7 +2042,9 @@ async def test_delete_policy_tag_async(transport: str = "grpc_asyncio"): def test_delete_policy_tag_field_headers(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1922,7 +2066,10 @@ def test_delete_policy_tag_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1951,11 +2098,16 @@ async def test_delete_policy_tag_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_policy_tag_flattened(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1966,7 +2118,9 @@ def test_delete_policy_tag_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_policy_tag(name="name_value",) + client.delete_policy_tag( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1977,13 +2131,16 @@ def test_delete_policy_tag_flattened(): def test_delete_policy_tag_flattened_error(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_policy_tag( - policytagmanager.DeletePolicyTagRequest(), name="name_value", + policytagmanager.DeletePolicyTagRequest(), + name="name_value", ) @@ -2003,7 +2160,9 @@ async def test_delete_policy_tag_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_policy_tag(name="name_value",) + response = await client.delete_policy_tag( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2023,7 +2182,8 @@ async def test_delete_policy_tag_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.delete_policy_tag( - policytagmanager.DeletePolicyTagRequest(), name="name_value", + policytagmanager.DeletePolicyTagRequest(), + name="name_value", ) @@ -2031,7 +2191,8 @@ def test_update_policy_tag( transport: str = "grpc", request_type=policytagmanager.UpdatePolicyTagRequest ): client = PolicyTagManagerClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2080,7 +2241,8 @@ def test_update_policy_tag_from_dict(): @pytest.mark.asyncio async def test_update_policy_tag_async(transport: str = "grpc_asyncio"): client = PolicyTagManagerAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2125,7 +2287,9 @@ async def test_update_policy_tag_async(transport: str = "grpc_asyncio"): def test_update_policy_tag_field_headers(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2147,9 +2311,10 @@ def test_update_policy_tag_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "policy_tag.name=policy_tag.name/value",) in kw[ - "metadata" - ] + assert ( + "x-goog-request-params", + "policy_tag.name=policy_tag.name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -2180,13 +2345,16 @@ async def test_update_policy_tag_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "policy_tag.name=policy_tag.name/value",) in kw[ - "metadata" - ] + assert ( + "x-goog-request-params", + "policy_tag.name=policy_tag.name/value", + ) in kw["metadata"] def test_update_policy_tag_flattened(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2210,7 +2378,9 @@ def test_update_policy_tag_flattened(): def test_update_policy_tag_flattened_error(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -2270,7 +2440,8 @@ def test_list_policy_tags( transport: str = "grpc", request_type=policytagmanager.ListPolicyTagsRequest ): client = PolicyTagManagerClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2307,7 +2478,8 @@ def test_list_policy_tags_from_dict(): @pytest.mark.asyncio async def test_list_policy_tags_async(transport: str = "grpc_asyncio"): client = PolicyTagManagerAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2340,7 +2512,9 @@ async def test_list_policy_tags_async(transport: str = "grpc_asyncio"): def test_list_policy_tags_field_headers(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2362,7 +2536,10 @@ def test_list_policy_tags_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -2393,11 +2570,16 @@ async def test_list_policy_tags_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_policy_tags_flattened(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2408,7 +2590,9 @@ def test_list_policy_tags_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_policy_tags(parent="parent_value",) + client.list_policy_tags( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2419,13 +2603,16 @@ def test_list_policy_tags_flattened(): def test_list_policy_tags_flattened_error(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_policy_tags( - policytagmanager.ListPolicyTagsRequest(), parent="parent_value", + policytagmanager.ListPolicyTagsRequest(), + parent="parent_value", ) @@ -2447,7 +2634,9 @@ async def test_list_policy_tags_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_policy_tags(parent="parent_value",) + response = await client.list_policy_tags( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2467,12 +2656,15 @@ async def test_list_policy_tags_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.list_policy_tags( - policytagmanager.ListPolicyTagsRequest(), parent="parent_value", + policytagmanager.ListPolicyTagsRequest(), + parent="parent_value", ) def test_list_policy_tags_pager(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials,) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2489,10 +2681,14 @@ def test_list_policy_tags_pager(): next_page_token="abc", ), policytagmanager.ListPolicyTagsResponse( - policy_tags=[], next_page_token="def", + policy_tags=[], + next_page_token="def", ), policytagmanager.ListPolicyTagsResponse( - policy_tags=[policytagmanager.PolicyTag(),], next_page_token="ghi", + policy_tags=[ + policytagmanager.PolicyTag(), + ], + next_page_token="ghi", ), policytagmanager.ListPolicyTagsResponse( policy_tags=[ @@ -2517,7 +2713,9 @@ def test_list_policy_tags_pager(): def test_list_policy_tags_pages(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials,) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2534,10 +2732,14 @@ def test_list_policy_tags_pages(): next_page_token="abc", ), policytagmanager.ListPolicyTagsResponse( - policy_tags=[], next_page_token="def", + policy_tags=[], + next_page_token="def", ), policytagmanager.ListPolicyTagsResponse( - policy_tags=[policytagmanager.PolicyTag(),], next_page_token="ghi", + policy_tags=[ + policytagmanager.PolicyTag(), + ], + next_page_token="ghi", ), policytagmanager.ListPolicyTagsResponse( policy_tags=[ @@ -2554,7 +2756,9 @@ def test_list_policy_tags_pages(): @pytest.mark.asyncio async def test_list_policy_tags_async_pager(): - client = PolicyTagManagerAsyncClient(credentials=credentials.AnonymousCredentials,) + client = PolicyTagManagerAsyncClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2573,10 +2777,14 @@ async def test_list_policy_tags_async_pager(): next_page_token="abc", ), policytagmanager.ListPolicyTagsResponse( - policy_tags=[], next_page_token="def", + policy_tags=[], + next_page_token="def", ), policytagmanager.ListPolicyTagsResponse( - policy_tags=[policytagmanager.PolicyTag(),], next_page_token="ghi", + policy_tags=[ + policytagmanager.PolicyTag(), + ], + next_page_token="ghi", ), policytagmanager.ListPolicyTagsResponse( policy_tags=[ @@ -2586,7 +2794,9 @@ async def test_list_policy_tags_async_pager(): ), RuntimeError, ) - async_pager = await client.list_policy_tags(request={},) + async_pager = await client.list_policy_tags( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -2598,7 +2808,9 @@ async def test_list_policy_tags_async_pager(): @pytest.mark.asyncio async def test_list_policy_tags_async_pages(): - client = PolicyTagManagerAsyncClient(credentials=credentials.AnonymousCredentials,) + client = PolicyTagManagerAsyncClient( + credentials=credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2617,10 +2829,14 @@ async def test_list_policy_tags_async_pages(): next_page_token="abc", ), policytagmanager.ListPolicyTagsResponse( - policy_tags=[], next_page_token="def", + policy_tags=[], + next_page_token="def", ), policytagmanager.ListPolicyTagsResponse( - policy_tags=[policytagmanager.PolicyTag(),], next_page_token="ghi", + policy_tags=[ + policytagmanager.PolicyTag(), + ], + next_page_token="ghi", ), policytagmanager.ListPolicyTagsResponse( policy_tags=[ @@ -2641,7 +2857,8 @@ def test_get_policy_tag( transport: str = "grpc", request_type=policytagmanager.GetPolicyTagRequest ): client = PolicyTagManagerClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2688,7 +2905,8 @@ def test_get_policy_tag_from_dict(): @pytest.mark.asyncio async def test_get_policy_tag_async(transport: str = "grpc_asyncio"): client = PolicyTagManagerAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2733,7 +2951,9 @@ async def test_get_policy_tag_async(transport: str = "grpc_asyncio"): def test_get_policy_tag_field_headers(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2753,7 +2973,10 @@ def test_get_policy_tag_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -2784,11 +3007,16 @@ async def test_get_policy_tag_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_policy_tag_flattened(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.get_policy_tag), "__call__") as call: @@ -2797,7 +3025,9 @@ def test_get_policy_tag_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_policy_tag(name="name_value",) + client.get_policy_tag( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2808,13 +3038,16 @@ def test_get_policy_tag_flattened(): def test_get_policy_tag_flattened_error(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_policy_tag( - policytagmanager.GetPolicyTagRequest(), name="name_value", + policytagmanager.GetPolicyTagRequest(), + name="name_value", ) @@ -2836,7 +3069,9 @@ async def test_get_policy_tag_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_policy_tag(name="name_value",) + response = await client.get_policy_tag( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2856,7 +3091,8 @@ async def test_get_policy_tag_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.get_policy_tag( - policytagmanager.GetPolicyTagRequest(), name="name_value", + policytagmanager.GetPolicyTagRequest(), + name="name_value", ) @@ -2864,7 +3100,8 @@ def test_get_iam_policy( transport: str = "grpc", request_type=iam_policy.GetIamPolicyRequest ): client = PolicyTagManagerClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2874,7 +3111,10 @@ def test_get_iam_policy( # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.get_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. - call.return_value = policy.Policy(version=774, etag=b"etag_blob",) + call.return_value = policy.Policy( + version=774, + etag=b"etag_blob", + ) response = client.get_iam_policy(request) @@ -2899,7 +3139,8 @@ def test_get_iam_policy_from_dict(): @pytest.mark.asyncio async def test_get_iam_policy_async(transport: str = "grpc_asyncio"): client = PolicyTagManagerAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2912,7 +3153,10 @@ async def test_get_iam_policy_async(transport: str = "grpc_asyncio"): ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - policy.Policy(version=774, etag=b"etag_blob",) + policy.Policy( + version=774, + etag=b"etag_blob", + ) ) response = await client.get_iam_policy(request) @@ -2932,7 +3176,9 @@ async def test_get_iam_policy_async(transport: str = "grpc_asyncio"): def test_get_iam_policy_field_headers(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2952,7 +3198,10 @@ def test_get_iam_policy_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -2981,11 +3230,16 @@ async def test_get_iam_policy_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] def test_get_iam_policy_from_dict(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.get_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. @@ -3004,7 +3258,8 @@ def test_set_iam_policy( transport: str = "grpc", request_type=iam_policy.SetIamPolicyRequest ): client = PolicyTagManagerClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3014,7 +3269,10 @@ def test_set_iam_policy( # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.set_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. - call.return_value = policy.Policy(version=774, etag=b"etag_blob",) + call.return_value = policy.Policy( + version=774, + etag=b"etag_blob", + ) response = client.set_iam_policy(request) @@ -3039,7 +3297,8 @@ def test_set_iam_policy_from_dict(): @pytest.mark.asyncio async def test_set_iam_policy_async(transport: str = "grpc_asyncio"): client = PolicyTagManagerAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3052,7 +3311,10 @@ async def test_set_iam_policy_async(transport: str = "grpc_asyncio"): ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - policy.Policy(version=774, etag=b"etag_blob",) + policy.Policy( + version=774, + etag=b"etag_blob", + ) ) response = await client.set_iam_policy(request) @@ -3072,7 +3334,9 @@ async def test_set_iam_policy_async(transport: str = "grpc_asyncio"): def test_set_iam_policy_field_headers(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3092,7 +3356,10 @@ def test_set_iam_policy_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -3121,11 +3388,16 @@ async def test_set_iam_policy_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] def test_set_iam_policy_from_dict(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client._transport.set_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. @@ -3144,7 +3416,8 @@ def test_test_iam_permissions( transport: str = "grpc", request_type=iam_policy.TestIamPermissionsRequest ): client = PolicyTagManagerClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3181,7 +3454,8 @@ def test_test_iam_permissions_from_dict(): @pytest.mark.asyncio async def test_test_iam_permissions_async(transport: str = "grpc_asyncio"): client = PolicyTagManagerAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3194,7 +3468,9 @@ async def test_test_iam_permissions_async(transport: str = "grpc_asyncio"): ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - iam_policy.TestIamPermissionsResponse(permissions=["permissions_value"],) + iam_policy.TestIamPermissionsResponse( + permissions=["permissions_value"], + ) ) response = await client.test_iam_permissions(request) @@ -3212,7 +3488,9 @@ async def test_test_iam_permissions_async(transport: str = "grpc_asyncio"): def test_test_iam_permissions_field_headers(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3234,7 +3512,10 @@ def test_test_iam_permissions_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -3265,11 +3546,16 @@ async def test_test_iam_permissions_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] def test_test_iam_permissions_from_dict(): - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client._transport.test_iam_permissions), "__call__" @@ -3293,7 +3579,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = PolicyTagManagerClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # It is an error to provide a credentials file and a transport instance. @@ -3312,7 +3599,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = PolicyTagManagerClient( - client_options={"scopes": ["1", "2"]}, transport=transport, + client_options={"scopes": ["1", "2"]}, + transport=transport, ) @@ -3342,8 +3630,13 @@ def test_transport_get_channel(): def test_transport_grpc_default(): # A client should use the gRPC transport by default. - client = PolicyTagManagerClient(credentials=credentials.AnonymousCredentials(),) - assert isinstance(client._transport, transports.PolicyTagManagerGrpcTransport,) + client = PolicyTagManagerClient( + credentials=credentials.AnonymousCredentials(), + ) + assert isinstance( + client._transport, + transports.PolicyTagManagerGrpcTransport, + ) def test_policy_tag_manager_base_transport_error(): @@ -3397,7 +3690,8 @@ def test_policy_tag_manager_base_transport_with_credentials_file(): Transport.return_value = None load_creds.return_value = (credentials.AnonymousCredentials(), None) transport = transports.PolicyTagManagerTransport( - credentials_file="credentials.json", quota_project_id="octopus", + credentials_file="credentials.json", + quota_project_id="octopus", ) load_creds.assert_called_once_with( "credentials.json", @@ -3635,7 +3929,9 @@ def test_taxonomy_path(): taxonomy = "whelk" expected = "projects/{project}/locations/{location}/taxonomies/{taxonomy}".format( - project=project, location=location, taxonomy=taxonomy, + project=project, + location=location, + taxonomy=taxonomy, ) actual = PolicyTagManagerClient.taxonomy_path(project, location, taxonomy) assert expected == actual @@ -3661,7 +3957,10 @@ def test_policy_tag_path(): policy_tag = "octopus" expected = "projects/{project}/locations/{location}/taxonomies/{taxonomy}/policyTags/{policy_tag}".format( - project=project, location=location, taxonomy=taxonomy, policy_tag=policy_tag, + project=project, + location=location, + taxonomy=taxonomy, + policy_tag=policy_tag, ) actual = PolicyTagManagerClient.policy_tag_path( project, location, taxonomy, policy_tag diff --git a/tests/unit/gapic/datacatalog_v1beta1/test_policy_tag_manager_serialization.py b/tests/unit/gapic/datacatalog_v1beta1/test_policy_tag_manager_serialization.py index 9676d368..211be942 100644 --- a/tests/unit/gapic/datacatalog_v1beta1/test_policy_tag_manager_serialization.py +++ b/tests/unit/gapic/datacatalog_v1beta1/test_policy_tag_manager_serialization.py @@ -313,7 +313,9 @@ def test_policy_tag_manager_serialization_client_client_options_scopes( client_class, transport_class, transport_name ): # Check the case scopes are provided. - options = client_options.ClientOptions(scopes=["1", "2"],) + options = client_options.ClientOptions( + scopes=["1", "2"], + ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options) @@ -386,7 +388,8 @@ def test_import_taxonomies( request_type=policytagmanagerserialization.ImportTaxonomiesRequest, ): client = PolicyTagManagerSerializationClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -419,7 +422,8 @@ def test_import_taxonomies_from_dict(): @pytest.mark.asyncio async def test_import_taxonomies_async(transport: str = "grpc_asyncio"): client = PolicyTagManagerSerializationAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -472,7 +476,10 @@ def test_import_taxonomies_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -503,7 +510,10 @@ async def test_import_taxonomies_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_export_taxonomies( @@ -511,7 +521,8 @@ def test_export_taxonomies( request_type=policytagmanagerserialization.ExportTaxonomiesRequest, ): client = PolicyTagManagerSerializationClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -544,7 +555,8 @@ def test_export_taxonomies_from_dict(): @pytest.mark.asyncio async def test_export_taxonomies_async(transport: str = "grpc_asyncio"): client = PolicyTagManagerSerializationAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -597,7 +609,10 @@ def test_export_taxonomies_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -628,7 +643,10 @@ async def test_export_taxonomies_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_credentials_transport_error(): @@ -638,7 +656,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = PolicyTagManagerSerializationClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=credentials.AnonymousCredentials(), + transport=transport, ) # It is an error to provide a credentials file and a transport instance. @@ -657,7 +676,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = PolicyTagManagerSerializationClient( - client_options={"scopes": ["1", "2"]}, transport=transport, + client_options={"scopes": ["1", "2"]}, + transport=transport, ) @@ -691,7 +711,8 @@ def test_transport_grpc_default(): credentials=credentials.AnonymousCredentials(), ) assert isinstance( - client._transport, transports.PolicyTagManagerSerializationGrpcTransport, + client._transport, + transports.PolicyTagManagerSerializationGrpcTransport, ) @@ -735,7 +756,8 @@ def test_policy_tag_manager_serialization_base_transport_with_credentials_file() Transport.return_value = None load_creds.return_value = (credentials.AnonymousCredentials(), None) transport = transports.PolicyTagManagerSerializationTransport( - credentials_file="credentials.json", quota_project_id="octopus", + credentials_file="credentials.json", + quota_project_id="octopus", ) load_creds.assert_called_once_with( "credentials.json",