Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#450)
Browse files Browse the repository at this point in the history
* fix(deps): Require google-api-core >=1.34.0, >=2.11.0

fix: Drop usage of pkg_resources

fix: Fix timeout default values

docs(samples): Snippetgen should call await on the operation coroutine before calling result

PiperOrigin-RevId: 493260409

Source-Link: googleapis/googleapis@fea4387

Source-Link: googleapis/googleapis-gen@387b734
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzg3YjczNDRjNzUyOWVlNDRiZTg0ZTYxM2IxOWE4MjA1MDhjNjEyYiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* add gapic_version.py

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
  • Loading branch information
3 people committed Dec 7, 2022
1 parent b9286cb commit 9682965
Show file tree
Hide file tree
Showing 24 changed files with 300 additions and 349 deletions.
5 changes: 0 additions & 5 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,3 @@ exclude_lines =
pragma: NO COVER
# Ignore debug-only repr
def __repr__
# Ignore pkg_resources exceptions.
# This is added at the module level as a safeguard for if someone
# generates the code and tries to run it without pip installing. This
# makes it virtually impossible to test properly.
except pkg_resources.DistributionNotFound
16 changes: 16 additions & 0 deletions google/cloud/datacatalog_v1/gapic_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "3.9.3" # {x-release-please-version}
78 changes: 37 additions & 41 deletions google/cloud/datacatalog_v1/services/data_catalog/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
from google.api_core.client_options import ClientOptions
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore
import pkg_resources

from google.cloud.datacatalog_v1 import gapic_version as package_version

try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
Expand Down Expand Up @@ -249,7 +250,7 @@ async def search_catalog(
scope: Optional[datacatalog.SearchCatalogRequest.Scope] = None,
query: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.SearchCatalogAsyncPager:
r"""Searches Data Catalog for multiple resources like entries and
Expand Down Expand Up @@ -408,7 +409,7 @@ async def create_entry_group(
entry_group_id: Optional[str] = None,
entry_group: Optional[datacatalog.EntryGroup] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> datacatalog.EntryGroup:
r"""Creates an entry group.
Expand Down Expand Up @@ -570,7 +571,7 @@ async def get_entry_group(
name: Optional[str] = None,
read_mask: Optional[field_mask_pb2.FieldMask] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> datacatalog.EntryGroup:
r"""Gets an entry group.
Expand Down Expand Up @@ -694,7 +695,7 @@ async def update_entry_group(
entry_group: Optional[datacatalog.EntryGroup] = None,
update_mask: Optional[field_mask_pb2.FieldMask] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> datacatalog.EntryGroup:
r"""Updates an entry group.
Expand Down Expand Up @@ -819,7 +820,7 @@ async def delete_entry_group(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
r"""Deletes an entry group.
Expand Down Expand Up @@ -914,7 +915,7 @@ async def list_entry_groups(
*,
parent: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListEntryGroupsAsyncPager:
r"""Lists entry groups.
Expand Down Expand Up @@ -1041,7 +1042,7 @@ async def create_entry(
entry_id: Optional[str] = None,
entry: Optional[datacatalog.Entry] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> datacatalog.Entry:
r"""Creates an entry.
Expand Down Expand Up @@ -1194,7 +1195,7 @@ async def update_entry(
entry: Optional[datacatalog.Entry] = None,
update_mask: Optional[field_mask_pb2.FieldMask] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> datacatalog.Entry:
r"""Updates an existing entry.
Expand Down Expand Up @@ -1354,7 +1355,7 @@ async def delete_entry(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
r"""Deletes an existing entry.
Expand Down Expand Up @@ -1453,7 +1454,7 @@ async def get_entry(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> datacatalog.Entry:
r"""Gets an entry.
Expand Down Expand Up @@ -1572,7 +1573,7 @@ async def lookup_entry(
request: Optional[Union[datacatalog.LookupEntryRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> datacatalog.Entry:
r"""Gets an entry by its target resource name.
Expand Down Expand Up @@ -1667,7 +1668,7 @@ async def list_entries(
*,
parent: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListEntriesAsyncPager:
r"""Lists entries.
Expand Down Expand Up @@ -1795,7 +1796,7 @@ async def modify_entry_overview(
request: Optional[Union[datacatalog.ModifyEntryOverviewRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> datacatalog.EntryOverview:
r"""Modifies entry overview, part of the business context of an
Expand Down Expand Up @@ -1880,7 +1881,7 @@ async def modify_entry_contacts(
request: Optional[Union[datacatalog.ModifyEntryContactsRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> datacatalog.Contacts:
r"""Modifies contacts, part of the business context of an
Expand Down Expand Up @@ -1966,7 +1967,7 @@ async def create_tag_template(
tag_template_id: Optional[str] = None,
tag_template: Optional[tags.TagTemplate] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> tags.TagTemplate:
r"""Creates a tag template.
Expand Down Expand Up @@ -2104,7 +2105,7 @@ async def get_tag_template(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> tags.TagTemplate:
r"""Gets a tag template.
Expand Down Expand Up @@ -2216,7 +2217,7 @@ async def update_tag_template(
tag_template: Optional[tags.TagTemplate] = None,
update_mask: Optional[field_mask_pb2.FieldMask] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> tags.TagTemplate:
r"""Updates a tag template.
Expand Down Expand Up @@ -2356,7 +2357,7 @@ async def delete_tag_template(
name: Optional[str] = None,
force: Optional[bool] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
r"""Deletes a tag template and all tags that use it.
Expand Down Expand Up @@ -2467,7 +2468,7 @@ async def create_tag_template_field(
tag_template_field_id: Optional[str] = None,
tag_template_field: Optional[tags.TagTemplateField] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> tags.TagTemplateField:
r"""Creates a field in a tag template.
Expand Down Expand Up @@ -2610,7 +2611,7 @@ async def update_tag_template_field(
tag_template_field: Optional[tags.TagTemplateField] = None,
update_mask: Optional[field_mask_pb2.FieldMask] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> tags.TagTemplateField:
r"""Updates a field in a tag template.
Expand Down Expand Up @@ -2758,7 +2759,7 @@ async def rename_tag_template_field(
name: Optional[str] = None,
new_tag_template_field_id: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> tags.TagTemplateField:
r"""Renames a field in a tag template.
Expand Down Expand Up @@ -2878,7 +2879,7 @@ async def rename_tag_template_field_enum_value(
name: Optional[str] = None,
new_enum_value_display_name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> tags.TagTemplateField:
r"""Renames an enum value in a tag template.
Expand Down Expand Up @@ -2994,7 +2995,7 @@ async def delete_tag_template_field(
name: Optional[str] = None,
force: Optional[bool] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
r"""Deletes a field in a tag template and all uses of this field
Expand Down Expand Up @@ -3103,7 +3104,7 @@ async def create_tag(
parent: Optional[str] = None,
tag: Optional[tags.Tag] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> tags.Tag:
r"""Creates a tag and assigns it to:
Expand Down Expand Up @@ -3244,7 +3245,7 @@ async def update_tag(
tag: Optional[tags.Tag] = None,
update_mask: Optional[field_mask_pb2.FieldMask] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> tags.Tag:
r"""Updates an existing tag.
Expand Down Expand Up @@ -3370,7 +3371,7 @@ async def delete_tag(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
r"""Deletes a tag.
Expand Down Expand Up @@ -3460,7 +3461,7 @@ async def list_tags(
*,
parent: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListTagsAsyncPager:
r"""Lists tags assigned to an
Expand Down Expand Up @@ -3592,7 +3593,7 @@ async def star_entry(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> datacatalog.StarEntryResponse:
r"""Marks an [Entry][google.cloud.datacatalog.v1.Entry] as starred
Expand Down Expand Up @@ -3697,7 +3698,7 @@ async def unstar_entry(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> datacatalog.UnstarEntryResponse:
r"""Marks an [Entry][google.cloud.datacatalog.v1.Entry] as NOT
Expand Down Expand Up @@ -3802,7 +3803,7 @@ async def set_iam_policy(
*,
resource: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> policy_pb2.Policy:
r"""Sets an access control policy for a resource. Replaces any
Expand Down Expand Up @@ -3987,7 +3988,7 @@ async def get_iam_policy(
*,
resource: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> policy_pb2.Policy:
r"""Gets the access control policy for a resource.
Expand Down Expand Up @@ -4184,7 +4185,7 @@ async def test_iam_permissions(
request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> iam_policy_pb2.TestIamPermissionsResponse:
r"""Gets your permissions on a resource.
Expand Down Expand Up @@ -4282,14 +4283,9 @@ async def __aexit__(self, exc_type, exc, tb):
await self.transport.close()


try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution(
"google-cloud-datacatalog",
).version,
)
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=package_version.__version__
)


__all__ = ("DataCatalogAsyncClient",)
Loading

0 comments on commit 9682965

Please sign in to comment.