3838from google .oauth2 import service_account # type: ignore
3939
4040try :
41- OptionalRetry = Union [retries .AsyncRetry , gapic_v1 .method ._MethodDefault ]
41+ OptionalRetry = Union [retries .AsyncRetry , gapic_v1 .method ._MethodDefault , None ]
4242except AttributeError : # pragma: NO COVER
43- OptionalRetry = Union [retries .AsyncRetry , object ] # type: ignore
43+ OptionalRetry = Union [retries .AsyncRetry , object , None ] # type: ignore
4444
4545from google .api_core import operation # type: ignore
4646from google .api_core import operation_async # type: ignore
@@ -67,8 +67,12 @@ class BigtableInstanceAdminAsyncClient:
6767
6868 _client : BigtableInstanceAdminClient
6969
70+ # Copy defaults from the synchronous client for use here.
71+ # Note: DEFAULT_ENDPOINT is deprecated. Use _DEFAULT_ENDPOINT_TEMPLATE instead.
7072 DEFAULT_ENDPOINT = BigtableInstanceAdminClient .DEFAULT_ENDPOINT
7173 DEFAULT_MTLS_ENDPOINT = BigtableInstanceAdminClient .DEFAULT_MTLS_ENDPOINT
74+ _DEFAULT_ENDPOINT_TEMPLATE = BigtableInstanceAdminClient ._DEFAULT_ENDPOINT_TEMPLATE
75+ _DEFAULT_UNIVERSE = BigtableInstanceAdminClient ._DEFAULT_UNIVERSE
7276
7377 app_profile_path = staticmethod (BigtableInstanceAdminClient .app_profile_path )
7478 parse_app_profile_path = staticmethod (
@@ -193,6 +197,25 @@ def transport(self) -> BigtableInstanceAdminTransport:
193197 """
194198 return self ._client .transport
195199
200+ @property
201+ def api_endpoint (self ):
202+ """Return the API endpoint used by the client instance.
203+
204+ Returns:
205+ str: The API endpoint used by the client instance.
206+ """
207+ return self ._client ._api_endpoint
208+
209+ @property
210+ def universe_domain (self ) -> str :
211+ """Return the universe domain used by the client instance.
212+
213+ Returns:
214+ str: The universe domain used
215+ by the client instance.
216+ """
217+ return self ._client ._universe_domain
218+
196219 get_transport_class = functools .partial (
197220 type (BigtableInstanceAdminClient ).get_transport_class ,
198221 type (BigtableInstanceAdminClient ),
@@ -206,7 +229,7 @@ def __init__(
206229 client_options : Optional [ClientOptions ] = None ,
207230 client_info : gapic_v1 .client_info .ClientInfo = DEFAULT_CLIENT_INFO ,
208231 ) -> None :
209- """Instantiates the bigtable instance admin client.
232+ """Instantiates the bigtable instance admin async client.
210233
211234 Args:
212235 credentials (Optional[google.auth.credentials.Credentials]): The
@@ -217,23 +240,38 @@ def __init__(
217240 transport (Union[str, ~.BigtableInstanceAdminTransport]): The
218241 transport to use. If set to None, a transport is chosen
219242 automatically.
220- client_options (ClientOptions): Custom options for the client. It
221- won't take effect if a ``transport`` instance is provided.
222- (1) The ``api_endpoint`` property can be used to override the
223- default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
224- environment variable can also be used to override the endpoint:
243+ client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]):
244+ Custom options for the client.
245+
246+ 1. The ``api_endpoint`` property can be used to override the
247+ default endpoint provided by the client when ``transport`` is
248+ not explicitly provided. Only if this property is not set and
249+ ``transport`` was not explicitly provided, the endpoint is
250+ determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment
251+ variable, which have one of the following values:
225252 "always" (always use the default mTLS endpoint), "never" (always
226- use the default regular endpoint) and "auto" (auto switch to the
227- default mTLS endpoint if client certificate is present, this is
228- the default value). However, the ``api_endpoint`` property takes
229- precedence if provided.
230- (2) If GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable
253+ use the default regular endpoint) and "auto" (auto- switch to the
254+ default mTLS endpoint if client certificate is present; this is
255+ the default value).
256+
257+ 2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable
231258 is "true", then the ``client_cert_source`` property can be used
232- to provide client certificate for mutual TLS transport. If
259+ to provide a client certificate for mTLS transport. If
233260 not provided, the default SSL client certificate will be used if
234261 present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not
235262 set, no client certificate will be used.
236263
264+ 3. The ``universe_domain`` property can be used to override the
265+ default "googleapis.com" universe. Note that ``api_endpoint``
266+ property still takes precedence; and ``universe_domain`` is
267+ currently not supported for mTLS.
268+
269+ client_info (google.api_core.gapic_v1.client_info.ClientInfo):
270+ The client info used to send a user-agent string along with
271+ API requests. If ``None``, then default info will be used.
272+ Generally, you only need to set this if you're developing
273+ your own client library.
274+
237275 Raises:
238276 google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport
239277 creation failed for any reason.
@@ -360,6 +398,9 @@ async def create_instance(
360398 gapic_v1 .routing_header .to_grpc_metadata ((("parent" , request .parent ),)),
361399 )
362400
401+ # Validate the universe domain.
402+ self ._client ._validate_universe_domain ()
403+
363404 # Send the request.
364405 response = await rpc (
365406 request ,
@@ -460,6 +501,9 @@ async def get_instance(
460501 gapic_v1 .routing_header .to_grpc_metadata ((("name" , request .name ),)),
461502 )
462503
504+ # Validate the universe domain.
505+ self ._client ._validate_universe_domain ()
506+
463507 # Send the request.
464508 response = await rpc (
465509 request ,
@@ -549,6 +593,9 @@ async def list_instances(
549593 gapic_v1 .routing_header .to_grpc_metadata ((("parent" , request .parent ),)),
550594 )
551595
596+ # Validate the universe domain.
597+ self ._client ._validate_universe_domain ()
598+
552599 # Send the request.
553600 response = await rpc (
554601 request ,
@@ -623,6 +670,9 @@ async def update_instance(
623670 gapic_v1 .routing_header .to_grpc_metadata ((("name" , request .name ),)),
624671 )
625672
673+ # Validate the universe domain.
674+ self ._client ._validate_universe_domain ()
675+
626676 # Send the request.
627677 response = await rpc (
628678 request ,
@@ -731,6 +781,9 @@ async def partial_update_instance(
731781 ),
732782 )
733783
784+ # Validate the universe domain.
785+ self ._client ._validate_universe_domain ()
786+
734787 # Send the request.
735788 response = await rpc (
736789 request ,
@@ -812,6 +865,9 @@ async def delete_instance(
812865 gapic_v1 .routing_header .to_grpc_metadata ((("name" , request .name ),)),
813866 )
814867
868+ # Validate the universe domain.
869+ self ._client ._validate_universe_domain ()
870+
815871 # Send the request.
816872 await rpc (
817873 request ,
@@ -920,6 +976,9 @@ async def create_cluster(
920976 gapic_v1 .routing_header .to_grpc_metadata ((("parent" , request .parent ),)),
921977 )
922978
979+ # Validate the universe domain.
980+ self ._client ._validate_universe_domain ()
981+
923982 # Send the request.
924983 response = await rpc (
925984 request ,
@@ -1019,6 +1078,9 @@ async def get_cluster(
10191078 gapic_v1 .routing_header .to_grpc_metadata ((("name" , request .name ),)),
10201079 )
10211080
1081+ # Validate the universe domain.
1082+ self ._client ._validate_universe_domain ()
1083+
10221084 # Send the request.
10231085 response = await rpc (
10241086 request ,
@@ -1110,6 +1172,9 @@ async def list_clusters(
11101172 gapic_v1 .routing_header .to_grpc_metadata ((("parent" , request .parent ),)),
11111173 )
11121174
1175+ # Validate the universe domain.
1176+ self ._client ._validate_universe_domain ()
1177+
11131178 # Send the request.
11141179 response = await rpc (
11151180 request ,
@@ -1184,6 +1249,9 @@ async def update_cluster(
11841249 gapic_v1 .routing_header .to_grpc_metadata ((("name" , request .name ),)),
11851250 )
11861251
1252+ # Validate the universe domain.
1253+ self ._client ._validate_universe_domain ()
1254+
11871255 # Send the request.
11881256 response = await rpc (
11891257 request ,
@@ -1299,6 +1367,9 @@ async def partial_update_cluster(
12991367 ),
13001368 )
13011369
1370+ # Validate the universe domain.
1371+ self ._client ._validate_universe_domain ()
1372+
13021373 # Send the request.
13031374 response = await rpc (
13041375 request ,
@@ -1380,6 +1451,9 @@ async def delete_cluster(
13801451 gapic_v1 .routing_header .to_grpc_metadata ((("name" , request .name ),)),
13811452 )
13821453
1454+ # Validate the universe domain.
1455+ self ._client ._validate_universe_domain ()
1456+
13831457 # Send the request.
13841458 await rpc (
13851459 request ,
@@ -1479,6 +1553,9 @@ async def create_app_profile(
14791553 gapic_v1 .routing_header .to_grpc_metadata ((("parent" , request .parent ),)),
14801554 )
14811555
1556+ # Validate the universe domain.
1557+ self ._client ._validate_universe_domain ()
1558+
14821559 # Send the request.
14831560 response = await rpc (
14841561 request ,
@@ -1569,6 +1646,9 @@ async def get_app_profile(
15691646 gapic_v1 .routing_header .to_grpc_metadata ((("name" , request .name ),)),
15701647 )
15711648
1649+ # Validate the universe domain.
1650+ self ._client ._validate_universe_domain ()
1651+
15721652 # Send the request.
15731653 response = await rpc (
15741654 request ,
@@ -1664,6 +1744,9 @@ async def list_app_profiles(
16641744 gapic_v1 .routing_header .to_grpc_metadata ((("parent" , request .parent ),)),
16651745 )
16661746
1747+ # Validate the universe domain.
1748+ self ._client ._validate_universe_domain ()
1749+
16671750 # Send the request.
16681751 response = await rpc (
16691752 request ,
@@ -1776,6 +1859,9 @@ async def update_app_profile(
17761859 ),
17771860 )
17781861
1862+ # Validate the universe domain.
1863+ self ._client ._validate_universe_domain ()
1864+
17791865 # Send the request.
17801866 response = await rpc (
17811867 request ,
@@ -1857,6 +1943,9 @@ async def delete_app_profile(
18571943 gapic_v1 .routing_header .to_grpc_metadata ((("name" , request .name ),)),
18581944 )
18591945
1946+ # Validate the universe domain.
1947+ self ._client ._validate_universe_domain ()
1948+
18601949 # Send the request.
18611950 await rpc (
18621951 request ,
@@ -1973,6 +2062,9 @@ async def get_iam_policy(
19732062 gapic_v1 .routing_header .to_grpc_metadata ((("resource" , request .resource ),)),
19742063 )
19752064
2065+ # Validate the universe domain.
2066+ self ._client ._validate_universe_domain ()
2067+
19762068 # Send the request.
19772069 response = await rpc (
19782070 request ,
@@ -2081,6 +2173,9 @@ async def set_iam_policy(
20812173 gapic_v1 .routing_header .to_grpc_metadata ((("resource" , request .resource ),)),
20822174 )
20832175
2176+ # Validate the universe domain.
2177+ self ._client ._validate_universe_domain ()
2178+
20842179 # Send the request.
20852180 response = await rpc (
20862181 request ,
@@ -2180,6 +2275,9 @@ async def test_iam_permissions(
21802275 gapic_v1 .routing_header .to_grpc_metadata ((("resource" , request .resource ),)),
21812276 )
21822277
2278+ # Validate the universe domain.
2279+ self ._client ._validate_universe_domain ()
2280+
21832281 # Send the request.
21842282 response = await rpc (
21852283 request ,
@@ -2273,6 +2371,9 @@ async def list_hot_tablets(
22732371 gapic_v1 .routing_header .to_grpc_metadata ((("parent" , request .parent ),)),
22742372 )
22752373
2374+ # Validate the universe domain.
2375+ self ._client ._validate_universe_domain ()
2376+
22762377 # Send the request.
22772378 response = await rpc (
22782379 request ,
0 commit comments