Skip to content

Commit

Permalink
🦉 Updates from OwlBot post-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] committed Oct 11, 2024
1 parent 11cd3ba commit a8d4e44
Show file tree
Hide file tree
Showing 125 changed files with 21,155 additions and 108,965 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
import inspect
import warnings
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union

Expand Down Expand Up @@ -237,6 +238,9 @@ def __init__(
)

# Wrap messages. This must be done after self._grpc_channel exists
self._wrap_with_kind = (
"kind" in inspect.signature(gapic_v1.method_async.wrap_method).parameters
)
self._prep_wrapped_messages(client_info)

@property
Expand Down Expand Up @@ -898,12 +902,12 @@ def list_hot_tablets(
def _prep_wrapped_messages(self, client_info):
"""Precompute the wrapped methods, overriding the base class method to use async wrappers."""
self._wrapped_methods = {
self.create_instance: gapic_v1.method_async.wrap_method(
self.create_instance: self._wrap_method(
self.create_instance,
default_timeout=300.0,
client_info=client_info,
),
self.get_instance: gapic_v1.method_async.wrap_method(
self.get_instance: self._wrap_method(
self.get_instance,
default_retry=retries.AsyncRetry(
initial=1.0,
Expand All @@ -918,7 +922,7 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.list_instances: gapic_v1.method_async.wrap_method(
self.list_instances: self._wrap_method(
self.list_instances,
default_retry=retries.AsyncRetry(
initial=1.0,
Expand All @@ -933,7 +937,7 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.update_instance: gapic_v1.method_async.wrap_method(
self.update_instance: self._wrap_method(
self.update_instance,
default_retry=retries.AsyncRetry(
initial=1.0,
Expand All @@ -948,7 +952,7 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.partial_update_instance: gapic_v1.method_async.wrap_method(
self.partial_update_instance: self._wrap_method(
self.partial_update_instance,
default_retry=retries.AsyncRetry(
initial=1.0,
Expand All @@ -963,17 +967,17 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.delete_instance: gapic_v1.method_async.wrap_method(
self.delete_instance: self._wrap_method(
self.delete_instance,
default_timeout=60.0,
client_info=client_info,
),
self.create_cluster: gapic_v1.method_async.wrap_method(
self.create_cluster: self._wrap_method(
self.create_cluster,
default_timeout=60.0,
client_info=client_info,
),
self.get_cluster: gapic_v1.method_async.wrap_method(
self.get_cluster: self._wrap_method(
self.get_cluster,
default_retry=retries.AsyncRetry(
initial=1.0,
Expand All @@ -988,7 +992,7 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.list_clusters: gapic_v1.method_async.wrap_method(
self.list_clusters: self._wrap_method(
self.list_clusters,
default_retry=retries.AsyncRetry(
initial=1.0,
Expand All @@ -1003,7 +1007,7 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.update_cluster: gapic_v1.method_async.wrap_method(
self.update_cluster: self._wrap_method(
self.update_cluster,
default_retry=retries.AsyncRetry(
initial=1.0,
Expand All @@ -1018,22 +1022,22 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.partial_update_cluster: gapic_v1.method_async.wrap_method(
self.partial_update_cluster: self._wrap_method(
self.partial_update_cluster,
default_timeout=None,
client_info=client_info,
),
self.delete_cluster: gapic_v1.method_async.wrap_method(
self.delete_cluster: self._wrap_method(
self.delete_cluster,
default_timeout=60.0,
client_info=client_info,
),
self.create_app_profile: gapic_v1.method_async.wrap_method(
self.create_app_profile: self._wrap_method(
self.create_app_profile,
default_timeout=60.0,
client_info=client_info,
),
self.get_app_profile: gapic_v1.method_async.wrap_method(
self.get_app_profile: self._wrap_method(
self.get_app_profile,
default_retry=retries.AsyncRetry(
initial=1.0,
Expand All @@ -1048,7 +1052,7 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.list_app_profiles: gapic_v1.method_async.wrap_method(
self.list_app_profiles: self._wrap_method(
self.list_app_profiles,
default_retry=retries.AsyncRetry(
initial=1.0,
Expand All @@ -1063,7 +1067,7 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.update_app_profile: gapic_v1.method_async.wrap_method(
self.update_app_profile: self._wrap_method(
self.update_app_profile,
default_retry=retries.AsyncRetry(
initial=1.0,
Expand All @@ -1078,12 +1082,12 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.delete_app_profile: gapic_v1.method_async.wrap_method(
self.delete_app_profile: self._wrap_method(
self.delete_app_profile,
default_timeout=60.0,
client_info=client_info,
),
self.get_iam_policy: gapic_v1.method_async.wrap_method(
self.get_iam_policy: self._wrap_method(
self.get_iam_policy,
default_retry=retries.AsyncRetry(
initial=1.0,
Expand All @@ -1098,12 +1102,12 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.set_iam_policy: gapic_v1.method_async.wrap_method(
self.set_iam_policy: self._wrap_method(
self.set_iam_policy,
default_timeout=60.0,
client_info=client_info,
),
self.test_iam_permissions: gapic_v1.method_async.wrap_method(
self.test_iam_permissions: self._wrap_method(
self.test_iam_permissions,
default_retry=retries.AsyncRetry(
initial=1.0,
Expand All @@ -1118,7 +1122,7 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.list_hot_tablets: gapic_v1.method_async.wrap_method(
self.list_hot_tablets: self._wrap_method(
self.list_hot_tablets,
default_retry=retries.AsyncRetry(
initial=1.0,
Expand All @@ -1135,8 +1139,17 @@ def _prep_wrapped_messages(self, client_info):
),
}

def _wrap_method(self, func, *args, **kwargs):
if self._wrap_with_kind: # pragma: NO COVER
kwargs["kind"] = self.kind
return gapic_v1.method_async.wrap_method(func, *args, **kwargs)

def close(self):
return self.grpc_channel.close()

@property
def kind(self) -> str:
return "grpc_asyncio"


__all__ = ("BigtableInstanceAdminGrpcAsyncIOTransport",)
Loading

0 comments on commit a8d4e44

Please sign in to comment.