@@ -388,6 +388,7 @@ def __init__(
388
388
client_options : client_options .ClientOptions ,
389
389
client_info : gapic_v1 .client_info .ClientInfo ,
390
390
credentials : Optional [auth_credentials .Credentials ] = None ,
391
+ transport : Optional [str ] = None ,
391
392
):
392
393
"""Stores parameters needed to instantiate client.
393
394
@@ -400,20 +401,30 @@ def __init__(
400
401
Required. Client info to pass to client.
401
402
credentials (auth_credentials.credentials):
402
403
Optional. Client credentials to pass to client.
404
+ transport (str):
405
+ Optional. Transport type to pass to client.
403
406
"""
404
407
405
408
self ._client_class = client_class
406
409
self ._credentials = credentials
407
410
self ._client_options = client_options
408
411
self ._client_info = client_info
412
+ self ._api_transport = transport
409
413
410
414
def __getattr__ (self , name : str ) -> Any :
411
415
"""Instantiates client and returns attribute of the client."""
412
- temporary_client = self ._client_class (
416
+
417
+ kwargs = dict (
413
418
credentials = self ._credentials ,
414
419
client_options = self ._client_options ,
415
420
client_info = self ._client_info ,
416
421
)
422
+
423
+ if self ._api_transport is not None :
424
+ kwargs ["transport" ] = self ._api_transport
425
+
426
+ temporary_client = self ._client_class (** kwargs )
427
+
417
428
return getattr (temporary_client , name )
418
429
419
430
@property
@@ -448,6 +459,7 @@ def __init__(
448
459
client_options : client_options .ClientOptions ,
449
460
client_info : gapic_v1 .client_info .ClientInfo ,
450
461
credentials : Optional [auth_credentials .Credentials ] = None ,
462
+ transport : Optional [str ] = None ,
451
463
):
452
464
"""Stores parameters needed to instantiate client.
453
465
@@ -458,21 +470,28 @@ def __init__(
458
470
Required. Client info to pass to client.
459
471
credentials (auth_credentials.credentials):
460
472
Optional. Client credentials to pass to client.
473
+ transport (str):
474
+ Optional. Transport type to pass to client.
461
475
"""
476
+ kwargs = dict (
477
+ credentials = credentials ,
478
+ client_options = client_options ,
479
+ client_info = client_info ,
480
+ )
481
+
482
+ if transport is not None :
483
+ kwargs ["transport" ] = transport
462
484
463
485
self ._clients = {
464
486
version : self .WrappedClient (
465
487
client_class = client_class ,
466
488
client_options = client_options ,
467
489
client_info = client_info ,
468
490
credentials = credentials ,
491
+ transport = transport ,
469
492
)
470
493
if self ._is_temporary
471
- else client_class (
472
- client_options = client_options ,
473
- client_info = client_info ,
474
- credentials = credentials ,
475
- )
494
+ else client_class (** kwargs )
476
495
for version , client_class in self ._version_map
477
496
}
478
497
0 commit comments