8000 feat: add new types ExplainOptions, ExplainMetrics, PlanSummary, Exec… · googleapis/python-datastore@dfbee2d · GitHub
[go: up one dir, main page]

Skip to content

Commit dfbee2d

Browse files
feat: add new types ExplainOptions, ExplainMetrics, PlanSummary, ExecutionStats (#521)
* feat: Allow users to explicitly configure universe domain chore: Update gapic-generator-python to v1.14.0 PiperOrigin-RevId: 603108274 Source-Link: googleapis/googleapis@3d83e36 Source-Link: googleapis/googleapis-gen@baf5e9b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmFmNWU5YmJiMTRhNzY4YjJiNGM5ZWFlOWZlYjc4ZjE4ZjE3NTdmYSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix: Resolve AttributeError 'Credentials' object has no attribute 'universe_domain' fix: Add google-auth as a direct dependency fix: Add staticmethod decorator to methods added in v1.14.0 chore: Update gapic-generator-python to v1.14.1 PiperOrigin-RevId: 603728206 Source-Link: googleapis/googleapis@9063da8 Source-Link: googleapis/googleapis-gen@891c67d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODkxYzY3ZDBhODU1YjA4MDg1ZWIzMDFkYWJiMTQwNjRlZjRiMmM2ZCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix(diregapic): s/bazel/bazelisk/ in DIREGAPIC build GitHub action PiperOrigin-RevId: 604714585 Source-Link: googleapis/googleapis@e4dce13 Source-Link: googleapis/googleapis-gen@4036f78 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDAzNmY3ODMwNWM1YzJhYWI4MGZmOTE5NjBiM2EzZDk4M2ZmNGIwMyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix(deps): Require `google-api-core>=1.34.1` fix: Resolve issue with missing import for certain enums in `**/types/…` PiperOrigin-RevId: 607041732 Source-Link: googleapis/googleapis@b453267 Source-Link: googleapis/googleapis-gen@cd79641 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2Q3OTY0MTZmMGY1NGNiMjJiMmM0NGZiMmQ0ODY5NjBlNjkzYTM0NiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix(deps): Exclude google-auth 2.24.0 and 2.25.0 chore: Update gapic-generator-python to v1.14.4 PiperOrigin-RevId: 611561820 Source-Link: googleapis/googleapis@87ef1fe Source-Link: googleapis/googleapis-gen@1973161 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTk3MzE2MTM3NTk0YWFmYWQ5NGRlYTMxMjI2NTI4ZmJjYzM5MzEwYyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: Add include_recaptcha_script for as a new action in firewall policies PiperOrigin-RevId: 612851792 Source-Link: googleapis/googleapis@49ea2c0 Source-Link: googleapis/googleapis-gen@460fdcb Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDYwZmRjYmJiZTAwZjM1YjFjNTkxYjFmM2VmMGM3N2ViZDNjZTI3NyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix coverage * fix(deps): require google-auth >= 2.14.1 * feat: add new types ExplainOptions, ExplainMetrics, PlanSummary, ExecutionStats feat: add ExplainOptions field to RunQueryRequest feat: add ExplainMetrics field to RunQueryResponse feat: add ExplainOptions field to RunAggregationQueryRequest feat: add ExplainMetrics field to RunAggregationQueryResponse PiperOrigin-RevId: 615158168 Source-Link: googleapis/googleapis@4d535ac Source-Link: googleapis/googleapis-gen@02e272d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDJlMjcyZGVkNTM4YjBmOTc4MzJiZmFkNDdkZWNiYzNkYzY1YTg5YSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 5fe7268 commit dfbee2d

Some content is hidden

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

44 files changed

+1899
-291
lines changed

google/cloud/datastore_admin/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2023 Google LLC
2+
# Copyright 2024 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

google/cloud/datastore_admin_v1/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2023 Google LLC
2+
# Copyright 2024 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

google/cloud/datastore_admin_v1/services/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2023 Google LLC
2+
# Copyright 2024 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

google/cloud/datastore_admin_v1/services/datastore_admin/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2023 Google LLC
2+
# Copyright 2024 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

google/cloud/datastore_admin_v1/services/datastore_admin/async_client.py

Lines changed: 83 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2023 Google LLC
2+
# Copyright 2024 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -38,9 +38,9 @@
3838
from google.oauth2 import service_account # type: ignore
3939

4040
try:
41-
OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault]
41+
OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault, None]
4242
except AttributeError: # pragma: NO COVER
43-
OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore
43+
OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore
4444

4545
from google.api_core import operation # type: ignore
4646
from google.api_core import operation_async # type: ignore
@@ -113,8 +113,12 @@ class DatastoreAdminAsyncClient:
113113

114114
_client: DatastoreAdminClient
115115

116+
# Copy defaults from the synchronous client for use here.
117+
# Note: DEFAULT_ENDPOINT is deprecated. Use _DEFAULT_ENDPOINT_TEMPLATE instead.
116118
DEFAULT_ENDPOINT = DatastoreAdminClient.DEFAULT_ENDPOINT
117119
DEFAULT_MTLS_ENDPOINT = DatastoreAdminClient.DEFAULT_MTLS_ENDPOINT
120+
_DEFAULT_ENDPOINT_TEMPLATE = DatastoreAdminClient._DEFAULT_ENDPOINT_TEMPLATE
121+
_DEFAULT_UNIVERSE = DatastoreAdminClient._DEFAULT_UNIVERSE
118122

119123
common_billing_account_path = staticmethod(
120124
DatastoreAdminClient.common_billing_account_path
@@ -219,6 +223,25 @@ def transport(self) -> DatastoreAdminTransport:
219223
"""
220224
return self._client.transport
221225

226+
@property
227+
def api_endpoint(self):
228+
"""Return the API endpoint used by the client instance.
229+
230+
Returns:
231+
str: The API endpoint used by the client instance.
232+
"""
233+
return self._client._api_endpoint
234+
235+
@property
236+
def universe_domain(self) -> str:
237+
"""Return the universe domain used by the client instance.
238+
239+
Returns:
240+
str: The universe domain used
241+
by the client instance.
242+
"""
243+
return self._client._universe_domain
244+
222245
get_transport_class = functools.partial(
223246
type(DatastoreAdminClient).get_transport_class, type(DatastoreAdminClient)
224247
)
@@ -231,7 +254,7 @@ def __init__(
231254
client_options: Optional[ClientOptions] = None,
232255
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
233256
) -> None:
234-
"""Instantiates the datastore admin client.
257+
"""Instantiates the datastore admin async client.
235258
236259
Args:
237260
credentials (Optional[google.auth.credentials.Credentials]): The
@@ -242,23 +265,38 @@ def __init__(
242265
transport (Union[str, ~.DatastoreAdminTransport]): The
243266
transport to use. If set to None, a transport is chosen
244267
automatically.
245-
client_options (ClientOptions): Custom options for the client. It
246-
won't take effect if a ``transport`` instance is provided.
247-
(1) The ``api_endpoint`` property can be used to override the
248-
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
249-
environment variable can also be used to override the endpoint:
268+
client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]):
269+
Custom options for the client.
270+
271+
1. The ``api_endpoint`` property can be used to override the
272+
default endpoint provided by the client when ``transport`` is
273+
not explicitly provided. Only if this property is not set and
274+
``transport`` was not explicitly provided, the endpoint is
275+
determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment
276+
variable, which have one of the following values:
250277
"always" (always use the default mTLS endpoint), "never" (always
251-
use the default regular endpoint) and "auto" (auto switch to the
252-
default mTLS endpoint if client certificate is present, this is
253-
the default value). However, the ``api_endpoint`` property takes
254-
precedence if provided.
255-
(2) If GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable
278+
use the default regular endpoint) and "auto" (auto-switch to the
279+
default mTLS endpoint if client certificate is present; this is
280+
the default value).
281+
282+
2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable
256283
is "true", then the ``client_cert_source`` property can be used
257-
to provide client certificate for mutual TLS transport. If
284+
to provide a client certificate for mTLS transport. If
258285
not provided, the default SSL client certificate will be used if
259286
present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not
260287
set, no client certificate will be used.
261288
289+
3. The ``universe_domain`` property can be used to override the
290+
default "googleapis.com" universe. Note that ``api_endpoint``
291+
property still takes precedence; and ``universe_domain`` is
292+
currently not supported for mTLS.
293+
294+
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
295+
The client info used to send a user-agent string along with
296+
API requests. If ``None``, then default info will be used.
297+
Generally, you only need to set this if you're developing
298+
your own client library.
299+
262300
Raises:
263301
google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport
264302
creation failed for any reason.
@@ -432,6 +470,9 @@ async def sample_export_entities():
432470
),
433471
)
434472

473+
# Validate the universe domain.
474+
self._client._validate_universe_domain()
475+
435476
# Send the request.
436477
response = await rpc(
437478
request,
@@ -611,6 +652,9 @@ async def sample_import_entities():
611652
),
612653
)
613654

655+
# Validate the universe domain.
656+
self._client._validate_universe_domain()
657+
614658
# Send the request.
615659
response = await rpc(
616660
request,
@@ -721,6 +765,9 @@ async def sample_create_index():
721765
),
722766
)
723767

768+
# Validate the universe domain.
769+
self._client._validate_universe_domain()
770+
724771
# Send the request.
725772
response = await rpc(
726773
request,
@@ -833,6 +880,9 @@ async def sample_delete_index():
833880
),
834881
)
835882

883+
# Validate the universe domain.
884+
self._client._validate_universe_domain()
885+
836886
# Send the request.
837887
response = await rpc(
838888
request,
@@ -933,6 +983,9 @@ async def sample_get_index():
933983
),
934984
)
935985

986+
# Validate the universe domain.
987+
self._client._validate_universe_domain()
988+
936989
# Send the request.
937990
response = await rpc(
938991
request,
@@ -1031,6 +1084,9 @@ async def sample_list_indexes():
10311084
),
10321085
)
10331086

1087+
# Validate the universe domain.
1088+
self._client._validate_universe_domain()
1089+
10341090
# Send the request.
10351091
response = await rpc(
10361092
request,
@@ -1094,6 +1150,9 @@ async def list_operations(
10941150
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
10951151
)
10961152

1153+
# Validate the universe domain.
1154+
self._client._validate_universe_domain()
1155+
10971156
# Send the request.
10981157
response = await rpc(
10991158
request,
@@ -1148,6 +1207,9 @@ async def get_operation(
11481207
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
11491208
)
11501209

1210+
# Validate the universe domain.
1211+
self._client._validate_universe_domain()
1212+
11511213
# Send the request.
11521214
response = await rpc(
11531215
request,
@@ -1206,6 +1268,9 @@ async def delete_operation(
12061268
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
12071269
)
12081270

1271+
# Validate the universe domain.
1272+
self._client._validate_universe_domain()
1273+
12091274
# Send the request.
12101275
await rpc(
12111276
request,
@@ -1260,6 +1325,9 @@ async def cancel_operation(
12601325
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
12611326
)
12621327

1328+
# Validate the universe domain.
1329+
self._client._validate_universe_domain()
1330+
12631331
# Send the request.
12641332
await rpc(
12651333
request,

0 commit comments

Comments
 (0)
0