Skip to content

Commit d9a3f90

Browse files
chore: [Many APIs] Update gapic-generator-python to v1.17.1 (#12638)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 629071173 Source-Link: googleapis/googleapis@4afa392 Source-Link: googleapis/googleapis-gen@16dbbb4 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRhdGFwbGV4Ly5Pd2xCb3QueWFtbCIsImgiOiIxNmRiYmI0ZDA0NTdkYjVlNjFhYzlmOTliMGQ1MmE0NjE1NDQ1NWFjIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRhdGFwcm9jLW1ldGFzdG9yZS8uT3dsQm90LnlhbWwiLCJoIjoiMTZkYmJiNGQwNDU3ZGI1ZTYxYWM5Zjk5YjBkNTJhNDYxNTQ0NTVhYyJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRhdGFwcm9jLy5Pd2xCb3QueWFtbCIsImgiOiIxNmRiYmI0ZDA0NTdkYjVlNjFhYzlmOTliMGQ1MmE0NjE1NDQ1NWFjIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRhdGFzdHJlYW0vLk93bEJvdC55YW1sIiwiaCI6IjE2ZGJiYjRkMDQ1N2RiNWU2MWFjOWY5OWIwZDUyYTQ2MTU0NDU1YWMifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRlcGxveS8uT3dsQm90LnlhbWwiLCJoIjoiMTZkYmJiNGQwNDU3ZGI1ZTYxYWM5Zjk5YjBkNTJhNDYxNTQ0NTVhYyJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpYWxvZ2Zsb3ctY3gvLk93bEJvdC55YW1sIiwiaCI6IjE2ZGJiYjRkMDQ1N2RiNWU2MWFjOWY5OWIwZDUyYTQ2MTU0NDU1YWMifQ== Copy-Tag: eyJwIjoicGFja2F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ot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 3d1901e commit d9a3f90

523 files changed

Lines changed: 115751 additions & 13565 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore/async_client.py

Lines changed: 167 additions & 140 deletions
Large diffs are not rendered by default.

packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore/client.py

Lines changed: 87 additions & 106 deletions
Large diffs are not rendered by default.

packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore/transports/grpc.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def __init__(
7474
credentials: Optional[ga_credentials.Credentials] = None,
7575
credentials_file: Optional[str] = None,
7676
scopes: Optional[Sequence[str]] = None,
77-
channel: Optional[grpc.Channel] = None,
77+
channel: Optional[Union[grpc.Channel, Callable[..., grpc.Channel]]] = None,
7878
api_mtls_endpoint: Optional[str] = None,
7979
client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
8080
ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None,
@@ -94,14 +94,17 @@ def __init__(
9494
credentials identify the application to the service; if none
9595
are specified, the client will attempt to ascertain the
9696
credentials from the environment.
97-
This argument is ignored if ``channel`` is provided.
97+
This argument is ignored if a ``channel`` instance is provided.
9898
credentials_file (Optional[str]): A file with credentials that can
9999
be loaded with :func:`google.auth.load_credentials_from_file`.
100-
This argument is ignored if ``channel`` is provided.
100+
This argument is ignored if a ``channel`` instance is provided.
101101
scopes (Optional(Sequence[str])): A list of scopes. This argument is
102-
ignored if ``channel`` is provided.
103-
channel (Optional[grpc.Channel]): A ``Channel`` instance through
104-
which to make calls.
102+
ignored if a ``channel`` instance is provided.
103+
channel (Optional[Union[grpc.Channel, Callable[..., grpc.Channel]]]):
104+
A ``Channel`` instance through which to make calls, or a Callable
105+
that constructs and returns one. If set to None, ``self.create_channel``
106+
is used to create the channel. If a Callable is given, it will be called
107+
with the same arguments as used in ``self.create_channel``.
105108
api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint.
106109
If provided, it overrides the ``host`` argument and tries to create
107110
a mutual TLS channel with client SSL credentials from
@@ -111,11 +114,11 @@ def __init__(
111114
private key bytes, both in PEM format. It is ignored if
112115
``api_mtls_endpoint`` is None.
113116
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
114-
for the grpc channel. It is ignored if ``channel`` is provided.
117+
for the grpc channel. It is ignored if a ``channel`` instance is provided.
115118
client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
116119
A callback to provide client certificate bytes and private key bytes,
117120
both in PEM format. It is used to configure a mutual TLS channel. It is
118-
ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
121+
ignored if a ``channel`` instance or ``ssl_channel_credentials`` is provided.
119122
quota_project_id (Optional[str]): An optional project to use for billing
120123
and quota.
121124
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
@@ -142,7 +145,7 @@ def __init__(
142145
if client_cert_source:
143146
warnings.warn("client_cert_source is deprecated", DeprecationWarning)
144147

145-
if channel:
148+
if isinstance(channel, grpc.Channel):
146149
# Ignore credentials if a channel was passed.
147150
credentials = False
148151
# If a channel was explicitly provided, set it.
@@ -183,7 +186,9 @@ def __init__(
183186
)
184187

185188
if not self._grpc_channel:
186-
self._grpc_channel = type(self).create_channel(
189+
# initialize with the provided callable or the default channel
190+
channel_init = channel or type(self).create_channel
191+
self._grpc_channel = channel_init(
187192
self._host,
188193
# use the credentials which are saved
189194
credentials=self._credentials,

packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore/transports/grpc_asyncio.py

Lines changed: 111 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union
1717
import warnings
1818

19+
from google.api_core import exceptions as core_exceptions
1920
from google.api_core import gapic_v1, grpc_helpers_async, operations_v1
21+
from google.api_core import retry_async as retries
2022
from google.auth import credentials as ga_credentials # type: ignore
2123
from google.auth.transport.grpc import SslCredentials # type: ignore
2224
from google.cloud.location import locations_pb2 # type: ignore
@@ -89,7 +91,6 @@ def create_channel(
8991
the credentials from the environment.
9092
credentials_file (Optional[str]): A file with credentials that can
9193
be loaded with :func:`google.auth.load_credentials_from_file`.
92-
This argument is ignored if ``channel`` is provided.
9394
scopes (Optional[Sequence[str]]): A optional list of scopes needed for this
9495
service. These are only used when credentials are not specified and
9596
are passed to :func:`google.auth.default`.
@@ -119,7 +120,7 @@ def __init__(
119120
credentials: Optional[ga_credentials.Credentials] = None,
120121
credentials_file: Optional[str] = None,
121122
scopes: Optional[Sequence[str]] = None,
122-
channel: Optional[aio.Channel] = None,
123+
channel: Optional[Union[aio.Channel, Callable[..., aio.Channel]]] = None,
123124
api_mtls_endpoint: Optional[str] = None,
124125
client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
125126
ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None,
@@ -139,15 +140,18 @@ def __init__(
139140
credentials identify the application to the service; if none
140141
are specified, the client will attempt to ascertain the
141142
credentials from the environment.
142-
This argument is ignored if ``channel`` is provided.
143+
This argument is ignored if a ``channel`` instance is provided.
143144
credentials_file (Optional[str]): A file with credentials that can
144145
be loaded with :func:`google.auth.load_credentials_from_file`.
145-
This argument is ignored if ``channel`` is provided.
146+
This argument is ignored if a ``channel`` instance is provided.
146147
scopes (Optional[Sequence[str]]): A optional list of scopes needed for this
147148
service. These are only used when credentials are not specified and
148149
are passed to :func:`google.auth.default`.
149-
channel (Optional[aio.Channel]): A ``Channel`` instance through
150-
which to make calls.
150+
channel (Optional[Union[aio.Channel, Callable[..., aio.Channel]]]):
151+
A ``Channel`` instance through which to make calls, or a Callable
152+
that constructs and returns one. If set to None, ``self.create_channel``
153+
is used to create the channel. If a Callable is given, it will be called
154+
with the same arguments as used in ``self.create_channel``.
151155
api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint.
152156
If provided, it overrides the ``host`` argument and tries to create
153157
a mutual TLS channel with client SSL credentials from
@@ -157,11 +161,11 @@ def __init__(
157161
private key bytes, both in PEM format. It is ignored if
158162
``api_mtls_endpoint`` is None.
159163
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
160-
for the grpc channel. It is ignored if ``channel`` is provided.
164+
for the grpc channel. It is ignored if a ``channel`` instance is provided.
161165
client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
162166
A callback to provide client certificate bytes and private key bytes,
163167
both in PEM format. It is used to configure a mutual TLS channel. It is
164-
ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
168+
ignored if a ``channel`` instance or ``ssl_channel_credentials`` is provided.
165169
quota_project_id (Optional[str]): An optional project to use for billing
166170
and quota.
167171
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
@@ -188,7 +192,7 @@ def __init__(
188192
if client_cert_source:
189193
warnings.warn("client_cert_source is deprecated", DeprecationWarning)
190194

191-
if channel:
195+
if isinstance(channel, aio.Channel):
192196
# Ignore credentials if a channel was passed.
193197
credentials = False
194198
# If a channel was explicitly provided, set it.
@@ -228,7 +232,9 @@ def __init__(
228232
)
229233

230234
if not self._grpc_channel:
231-
self._grpc_channel = type(self).create_channel(
235+
# initialize with the provided callable or the default channel
236+
channel_init = channel or type(self).create_channel
237+
self._grpc_channel = channel_init(
232238
self._host,
233239
# use the credentials which are saved
234240
credentials=self._credentials,
@@ -782,6 +788,101 @@ def alter_metadata_resource_location(
782788
)
783789
return self._stubs["alter_metadata_resource_location"]
784790

791+
def _prep_wrapped_messages(self, client_info):
792+
"""Precompute the wrapped methods, overriding the base class method to use async wrappers."""
793+
self._wrapped_methods = {
794+
self.list_services: gapic_v1.method_async.wrap_method(
795+
self.list_services,
796+
default_timeout=None,
797+
client_info=client_info,
798+
),
799+
self.get_service: gapic_v1.method_async.wrap_method(
800+
self.get_service,
801+
default_timeout=None,
802+
client_info=client_info,
803+
),
804+
self.create_service: gapic_v1.method_async.wrap_method(
805+
self.create_service,
806+
default_timeout=60.0,
807+
client_info=client_info,
808+
),
809+
self.update_service: gapic_v1.method_async.wrap_method(
810+
self.update_service,
811+
default_timeout=60.0,
812+
client_info=client_info,
813+
),
814+
self.delete_service: gapic_v1.method_async.wrap_method(
815+
self.delete_service,
816+
default_timeout=60.0,
817+
client_info=client_info,
818+
),
819+
self.list_metadata_imports: gapic_v1.method_async.wrap_method(
820+
self.list_metadata_imports,
821+
default_timeout=None,
822+
client_info=client_info,
823+
),
824+
self.get_metadata_import: gapic_v1.method_async.wrap_method(
825+
self.get_metadata_import,
826+
default_timeout=None,
827+
client_info=client_info,
828+
),
829+
self.create_metadata_import: gapic_v1.method_async.wrap_method(
830+
self.create_metadata_import,
831+
default_timeout=60.0,
832+
client_info=client_info,
833+
),
834+
self.update_metadata_import: gapic_v1.method_async.wrap_method(
835+
self.update_metadata_import,
836+
default_timeout=60.0,
837+
client_info=client_info,
838+
),
839+
self.export_metadata: gapic_v1.method_async.wrap_method(
840+
self.export_metadata,
841+
default_timeout=60.0,
842+
client_info=client_info,
843+
),
844+
self.restore_service: gapic_v1.method_async.wrap_method(
845+
self.restore_service,
846+
default_timeout=60.0,
847+
client_info=client_info,
848+
),
849+
self.list_backups: gapic_v1.method_async.wrap_method(
850+
self.list_backups,
851+
default_timeout=None,
852+
client_info=client_info,
853+
),
854+
self.get_backup: gapic_v1.method_async.wrap_method(
855+
self.get_backup,
856+
default_timeout=None,
857+
client_info=client_info,
858+
),
859+
self.create_backup: gapic_v1.method_async.wrap_method(
860+
self.create_backup,
861+
default_timeout=60.0,
862+
client_info=client_info,
863+
),
864+
self.delete_backup: gapic_v1.method_async.wrap_method(
865+
self.delete_backup,
866+
default_timeout=60.0,
867+
client_info=client_info,
868+
),
869+
self.query_metadata: gapic_v1.method_async.wrap_method(
870+
self.query_metadata,
871+
default_timeout=None,
872+
client_info=client_info,
873+
),
874+
self.move_table_to_database: gapic_v1.method_async.wrap_method(
875+
self.move_table_to_database,
876+
default_timeout=None,
877+
client_info=client_info,
878+
),
879+
self.alter_metadata_resource_location: gapic_v1.method_async.wrap_method(
880+
self.alter_metadata_resource_location,
881+
default_timeout=None,
882+
client_info=client_info,
883+
),
884+
}
885+
785886
def close(self):
786887
return self.grpc_channel.close()
787888

0 commit comments

Comments
 (0)