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 fc06790 commit 0c72d5d
Show file tree
Hide file tree
Showing 171 changed files with 2,739 additions and 62,649 deletions.
18 changes: 3 additions & 15 deletions google/cloud/logging_v2/services/config_service_v2/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3928,11 +3928,7 @@ async def list_operations(

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.list_operations,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
)
rpc = self.transport._wrapped_methods[self._client._transport.list_operations]

# Certain fields should be provided within the metadata header;
# add these here.
Expand Down Expand Up @@ -3985,11 +3981,7 @@ async def get_operation(

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.get_operation,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
)
rpc = self.transport._wrapped_methods[self._client._transport.get_operation]

# Certain fields should be provided within the metadata header;
# add these here.
Expand Down Expand Up @@ -4045,11 +4037,7 @@ async def cancel_operation(

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.cancel_operation,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
)
rpc = self.transport._wrapped_methods[self._client._transport.cancel_operation]

# Certain fields should be provided within the metadata header;
# add these here.
Expand Down
18 changes: 3 additions & 15 deletions google/cloud/logging_v2/services/config_service_v2/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4381,11 +4381,7 @@ def list_operations(

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method.wrap_method(
self._transport.list_operations,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
)
rpc = self._transport._wrapped_methods[self._transport.list_operations]

# Certain fields should be provided within the metadata header;
# add these here.
Expand Down Expand Up @@ -4438,11 +4434,7 @@ def get_operation(

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method.wrap_method(
self._transport.get_operation,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
)
rpc = self._transport._wrapped_methods[self._transport.get_operation]

# Certain fields should be provided within the metadata header;
# add these here.
Expand Down Expand Up @@ -4498,11 +4490,7 @@ def cancel_operation(

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method.wrap_method(
self._transport.cancel_operation,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
)
rpc = self._transport._wrapped_methods[self._transport.cancel_operation]

# Certain fields should be provided within the metadata header;
# add these here.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,21 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=None,
client_info=client_info,
),
self.cancel_operation: gapic_v1.method.wrap_method(
self.cancel_operation,
default_timeout=None,
client_info=client_info,
),
self.get_operation: gapic_v1.method.wrap_method(
self.get_operation,
default_timeout=None,
client_info=client_info,
),
self.list_operations: gapic_v1.method.wrap_method(
self.list_operations,
default_timeout=None,
client_info=client_info,
),
}

def close(self):
Expand Down
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 @@ -231,6 +232,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 @@ -1246,72 +1250,72 @@ def copy_log_entries(
def _prep_wrapped_messages(self, client_info):
"""Precompute the wrapped methods, overriding the base class method to use async wrappers."""
self._wrapped_methods = {
self.list_buckets: gapic_v1.method_async.wrap_method(
self.list_buckets: self._wrap_method(
self.list_buckets,
default_timeout=None,
client_info=client_info,
),
self.get_bucket: gapic_v1.method_async.wrap_method(
self.get_bucket: self._wrap_method(
self.get_bucket,
default_timeout=None,
client_info=client_info,
),
self.create_bucket_async: gapic_v1.method_async.wrap_method(
self.create_bucket_async: self._wrap_method(
self.create_bucket_async,
default_timeout=None,
client_info=client_info,
),
self.update_bucket_async: gapic_v1.method_async.wrap_method(
self.update_bucket_async: self._wrap_method(
self.update_bucket_async,
default_timeout=None,
client_info=client_info,
),
self.create_bucket: gapic_v1.method_async.wrap_method(
self.create_bucket: self._wrap_method(
self.create_bucket,
default_timeout=None,
client_info=client_info,
),
self.update_bucket: gapic_v1.method_async.wrap_method(
self.update_bucket: self._wrap_method(
self.update_bucket,
default_timeout=None,
client_info=client_info,
),
self.delete_bucket: gapic_v1.method_async.wrap_method(
self.delete_bucket: self._wrap_method(
self.delete_bucket,
default_timeout=None,
client_info=client_info,
),
self.undelete_bucket: gapic_v1.method_async.wrap_method(
self.undelete_bucket: self._wrap_method(
self.undelete_bucket,
default_timeout=None,
client_info=client_info,
),
self.list_views: gapic_v1.method_async.wrap_method(
self.list_views: self._wrap_method(
self.list_views,
default_timeout=None,
client_info=client_info,
),
self.get_view: gapic_v1.method_async.wrap_method(
self.get_view: self._wrap_method(
self.get_view,
default_timeout=None,
client_info=client_info,
),
self.create_view: gapic_v1.method_async.wrap_method(
self.create_view: self._wrap_method(
self.create_view,
default_timeout=None,
client_info=client_info,
),
self.update_view: gapic_v1.method_async.wrap_method(
self.update_view: self._wrap_method(
self.update_view,
default_timeout=None,
client_info=client_info,
),
self.delete_view: gapic_v1.method_async.wrap_method(
self.delete_view: self._wrap_method(
self.delete_view,
default_timeout=None,
client_info=client_info,
),
self.list_sinks: gapic_v1.method_async.wrap_method(
self.list_sinks: self._wrap_method(
self.list_sinks,
default_retry=retries.AsyncRetry(
initial=0.1,
Expand All @@ -1327,7 +1331,7 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.get_sink: gapic_v1.method_async.wrap_method(
self.get_sink: self._wrap_method(
self.get_sink,
default_retry=retries.AsyncRetry(
initial=0.1,
Expand All @@ -1343,12 +1347,12 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.create_sink: gapic_v1.method_async.wrap_method(
self.create_sink: self._wrap_method(
self.create_sink,
default_timeout=120.0,
client_info=client_info,
),
self.update_sink: gapic_v1.method_async.wrap_method(
self.update_sink: self._wrap_method(
self.update_sink,
default_retry=retries.AsyncRetry(
initial=0.1,
Expand All @@ -1364,7 +1368,7 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.delete_sink: gapic_v1.method_async.wrap_method(
self.delete_sink: self._wrap_method(
self.delete_sink,
default_retry=retries.AsyncRetry(
initial=0.1,
Expand All @@ -1380,27 +1384,27 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.create_link: gapic_v1.method_async.wrap_method(
self.create_link: self._wrap_method(
self.create_link,
default_timeout=None,
client_info=client_info,
),
self.delete_link: gapic_v1.method_async.wrap_method(
self.delete_link: self._wrap_method(
self.delete_link,
default_timeout=None,
client_info=client_info,
),
self.list_links: gapic_v1.method_async.wrap_method(
self.list_links: self._wrap_method(
self.list_links,
default_timeout=None,
client_info=client_info,
),
self.get_link: gapic_v1.method_async.wrap_method(
self.get_link: self._wrap_method(
self.get_link,
default_timeout=None,
client_info=client_info,
),
self.list_exclusions: gapic_v1.method_async.wrap_method(
self.list_exclusions: self._wrap_method(
self.list_exclusions,
default_retry=retries.AsyncRetry(
initial=0.1,
Expand All @@ -1416,7 +1420,7 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.get_exclusion: gapic_v1.method_async.wrap_method(
self.get_exclusion: self._wrap_method(
self.get_exclusion,
default_retry=retries.AsyncRetry(
initial=0.1,
Expand All @@ -1432,17 +1436,17 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.create_exclusion: gapic_v1.method_async.wrap_method(
self.create_exclusion: self._wrap_method(
self.create_exclusion,
default_timeout=120.0,
client_info=client_info,
),
self.update_exclusion: gapic_v1.method_async.wrap_method(
self.update_exclusion: self._wrap_method(
self.update_exclusion,
default_timeout=120.0,
client_info=client_info,
),
self.delete_exclusion: gapic_v1.method_async.wrap_method(
self.delete_exclusion: self._wrap_method(
self.delete_exclusion,
default_retry=retries.AsyncRetry(
initial=0.1,
Expand All @@ -1458,36 +1462,60 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.get_cmek_settings: gapic_v1.method_async.wrap_method(
self.get_cmek_settings: self._wrap_method(
self.get_cmek_settings,
default_timeout=None,
client_info=client_info,
),
self.update_cmek_settings: gapic_v1.method_async.wrap_method(
self.update_cmek_settings: self._wrap_method(
self.update_cmek_settings,
default_timeout=None,
client_info=client_info,
),
self.get_settings: gapic_v1.method_async.wrap_method(
self.get_settings: self._wrap_method(
self.get_settings,
default_timeout=None,
client_info=client_info,
),
self.update_settings: gapic_v1.method_async.wrap_method(
self.update_settings: self._wrap_method(
self.update_settings,
default_timeout=None,
client_info=client_info,
),
self.copy_log_entries: gapic_v1.method_async.wrap_method(
self.copy_log_entries: self._wrap_method(
self.copy_log_entries,
default_timeout=None,
client_info=client_info,
),
self.cancel_operation: self._wrap_method(
self.cancel_operation,
default_timeout=None,
client_info=client_info,
),
self.get_operation: self._wrap_method(
self.get_operation,
default_timeout=None,
client_info=client_info,
),
self.list_operations: self._wrap_method(
self.list_operations,
default_timeout=None,
client_info=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"

@property
def cancel_operation(
self,
Expand Down
Loading

0 comments on commit 0c72d5d

Please sign in to comment.